-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move from variant map to array (rebased) #443
Conversation
Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 86edf17 This is a development version and should only be installed for testing purposes.
Hash: (by dappnodebot/build-action) |
src/commands/build/variants.ts
Outdated
allVariants, | ||
variantsStr, | ||
rootDir, | ||
variantsDirName, | ||
variantsDirPath, | ||
composeFileName | ||
}: { | ||
allVariants: boolean; | ||
variantsStr?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isnt a bit confusing the name variantsStr
? what about using variantsName
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the string you receive from console after flag --variants
, like:
--variants mainnet,holesky,lukso
src/types.ts
Outdated
// Manifest-related | ||
manifest: Manifest; | ||
manifestFormat: ManifestFormat; | ||
} | ||
|
||
export interface BuildVariantsMapEntry extends PublishVariantsMapEntry { | ||
export interface PackageToBuildProps extends PackageToPublishProps { | ||
variant: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your intentions allowing null
if null means something either add a comment or find a way to define such intention with a boolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, what means exactly variant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment. variant
could be mainnet
, testnet
, holesky
... the value that makes one package differ from another in the same repo. It must be equal to the directory where that variant files are defined. For example, if you want to build the holesky
and mainnet
variants of a package, you would run:
`dappnodesdk build --variants-dir "./package_variants" --variants "mainnet,holesky"
And your repo must include these files:
.
├── avatar.png
├── dappnode_package.json
├── docker-compose.yml
...
├── package_variants
│ ├── holesky
│ │ ├── dappnode_package.json
│ │ └── docker-compose.yml
│ └── mainnet
│ ├── dappnode_package.json
│ └── docker-compose.yml
└── README.md
@@ -10,9 +10,9 @@ export interface CliGlobalOptions { | |||
|
|||
// TODO: Try to have all properties defined | |||
interface ListrContextBuildItem { | |||
releaseDir?: string; | |||
variant: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as below. What means variant? what is the intention behind the scenes allowing null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variant meaning is explained here: #443 (comment)
It can be null
because legacy format packages (with full compose and manifest files in the root of the repo) have no variant
so it makes sense that it is explicitly null
}: { | ||
rootDir: string; | ||
composeFileName: string; | ||
variant: string; | ||
variant: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why allowing null? ist better the usage of a boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I added a boolean, variant
would still have to be undefined
or null
for single packages, so I would say it does not provide any value.
This PR overrides #440, as code base was out of date.
It aims to move from type:
to type: