Skip to content

Commit

Permalink
Merge pull request #33 from Exabyte-io/feat/SOF-6631
Browse files Browse the repository at this point in the history
feat/SOF-6631: prepare libs for hp.x
  • Loading branch information
timurbazhirov authored Aug 26, 2023
2 parents ccaf7b3 + bb5cb74 commit 175dd91
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@exabyte-io/code.js": "2023.8.10-0",
"@exabyte-io/eslint-config": "^2022.11.17-0",
"@exabyte-io/made.js": "2022.6.15-0",
"@exabyte-io/application-flavors.js": "2023.8.11-0",
"@exabyte-io/application-flavors.js": "2023.8.26-0",
"chai": "^4.3.4",
"eslint": "7.32.0",
"eslint-config-airbnb": "19.0.2",
Expand Down
14 changes: 11 additions & 3 deletions src/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,17 @@ export class Application extends NamedDefaultableInMemoryEntity {

get executables() {
const tree = getAppTree(this.prop("name"));
return Object.keys(tree).map((key) => {
return new this.constructor.Executable({ ...tree[key], name: key });
});
return Object.keys(tree)
.filter((key) => {
const { supportedApplicationVersions } = tree[key];
return (
!supportedApplicationVersions ||
supportedApplicationVersions.includes(this.prop("version"))
);
})
.map((key) => {
return new this.constructor.Executable({ ...tree[key], name: key });
});
}

get hasAdvancedComputeOptions() {
Expand Down
9 changes: 9 additions & 0 deletions src/executable.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,13 @@ export class Executable extends mix(NamedDefaultableInMemoryEntity).with(Runtime
getFlavorByConfig(config) {
return config ? this.getFlavorByName(config.name) : this.defaultFlavor;
}

getFlavorsByApplicationVersion(version) {
const filteredFlavors = this.flavors.filter((flavor) => {
const supportedApplicationVersions = flavor.prop("supportedApplicationVersions");
return !supportedApplicationVersions || supportedApplicationVersions.includes(version);
});

return filteredFlavors;
}
}

0 comments on commit 175dd91

Please sign in to comment.