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

feat: create script for updating lists of ecosystems #303

Merged
merged 9 commits into from
Nov 5, 2024

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented Oct 21, 2024

This introduces a new script to make it easier to ensure all "lists of ecosystems" within this codebase remain up to date, including:

To make it a bit easier, I've introduced a top-level ecosystems.json which is a map of defined ecosystems and a markdown description, sorted alphabetically (which the script also ensures) - I felt this was easier than trying to extract the list from markdown or another source, though it does mean double quotes need to be manually escaped.

I went with JSON as it can be read without requiring an external dependency, though if we use Python 3.11 we could switch to toml instead as that ships with tomllib

Example of the workflow output:

image

image

@G-Rath
Copy link
Contributor Author

G-Rath commented Oct 23, 2024

#292 (comment) made me think we should later expand ecosystems.json to include other properties like if an ecosystem supports a prefix i.e.

{
  "npm": {
    "description": "xyz",
    "supportsSuffix": false
  }
}

@G-Rath G-Rath force-pushed the create-generator branch 3 times, most recently from 9e00109 to b4c776b Compare October 29, 2024 23:00
validation/schema.json Outdated Show resolved Hide resolved
another-rex pushed a commit that referenced this pull request Oct 30, 2024
This reformates the JSON schema file to reduce the diff on #303 since
currently there's a section that is incorrectly indented

Signed-off-by: Gareth Jones <[email protected]>
@G-Rath G-Rath marked this pull request as ready for review October 30, 2024 03:05
| Ecosystem | Description |
| --------- |-----------------|
| `AlmaLinux` | AlmaLinux package ecosystem; the `name` is the name of the source package. The ecosystem string might optionally have a `:<RELEASE>` suffix to scope the package to a particular AlmaLinux release. `<RELEASE>` is a numeric version.
<!-- begin auto-generated ecosystems list -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a pointer to the source of truth for this in the comment? So that contributors know where to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a little something - I don't think it's perfect but hopefully enough to unblock for now

(I imagine we can improve on this over time as we see how our usage of ecosystems.json and co evolve)

@G-Rath G-Rath requested a review from oliverchang November 4, 2024 19:10
scripts/update-ecosystems-lists.py Outdated Show resolved Hide resolved
@oliverchang oliverchang merged commit c767f97 into ossf:main Nov 5, 2024
4 checks passed
@G-Rath G-Rath deleted the create-generator branch November 5, 2024 19:38
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

Successfully merging this pull request may close these issues.

2 participants