Skip to content
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

Support multiple team/supplier names in metadata for GitHub Marketplace #149

Open
dennis-sig opened this issue Dec 6, 2022 · 1 comment

Comments

@dennis-sig
Copy link
Contributor

Suggested by @bruno-oliveira. We support 4 options for supplying metadata. The 4th option is based on providing input parameters to the GitHub Action, and is typically used by people that use Sigrid CI directly from GitHub Marketplace. Because those input parameters are strings, we don't currently allow people to use multiple values for the 2 metadata fields that accept arrays: supplierNames and teamNames.

We need to investigate if lists/arrays are nowadays supported as input parameters. If not, we can still use poor man's lists using the notation aap,noot, but we need to check.

@nicorikken
Copy link
Contributor

In sigridci.py there is already a hardcoded interpretation of teamNames that makes is difficult to supply multiple values:

with open(f"{options.sourceDir}/sigrid-metadata.yaml", "w") as writer:
writer.write("metadata:\n")
for name, value in metadata.items():
formattedValue = f"[\"{value}\"]" if name in ["teamNames", "supplierNames"] else f"\"{value}\""
writer.write(f" {name}: {formattedValue}\n")

One hack I now use is to supply a string with quoted values that misses the quotes at the end: team A", "team B", "team C which will end up as ["team A", "team B", "team C"] in the yaml that will get uploaded.

A cleaner alternative is to make a separate call to the API for which it is easier to provide a list.

At the moment a comma-separated list is still considered best-practice for GitHub Actions, which could also work on the commandline with environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants