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

add generators metadata file #1

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Conversation

Alice-Lilith
Copy link

@Alice-Lilith Alice-Lilith commented Jan 29, 2024

Adds a metadata file to the root of the repo that contains info about all the available generators. The contents are populated using the new Makefile target. You can simply run make or make generate to update the file. It aggregates the metadata of each generator's config file.

I was originally going to use a hash of the directory for each generator and store that in the metadata file so that clients can check if their cached version is out of date or not. I decided against this approach for now since it was difficult to standardize hashes between machines, likely in-part due to things like line endings, metadata, and whatnot. Instead, clients will make use of the version field for now when comparing their locally cached instance against what is in the repo.

As far as downloads go, I wasn't too sure what the best way to deal with them are. You can't easily download a specific directory from a GitHub repo without making heavy use of the github API to walk that directory and download all the files while rebuilding the directory structure locally and the github public API has a limit of 60 requests per hours so that's not a feasible option. For now, clients will just download the individual generators.json file to check if they need to update their caches, then download the .zip of the main branch. We could pre-zip each generator directory and store those .zips in the repo but that feels messy/confusing. We could also create an individual release for each generator whenever it changes and store those download URLs for that generator's release in the generators.json file so clients can easily download only the generator they want.

@Alice-Lilith Alice-Lilith changed the title Alicewasko/generators metadata add generators metadata file Jan 29, 2024
@Alice-Lilith Alice-Lilith force-pushed the alicewasko/generators-metadata branch 4 times, most recently from a86f49c to 4d82a14 Compare January 30, 2024 23:15
Alice Wasko added 2 commits January 30, 2024 18:03
Signed-off-by: Alice Wasko <[email protected]>
Signed-off-by: Alice Wasko <[email protected]>
@Alice-Lilith Alice-Lilith marked this pull request as ready for review January 31, 2024 03:21
@Alice-Lilith Alice-Lilith merged commit ccb8039 into main Jan 31, 2024
1 check passed
@Alice-Lilith Alice-Lilith deleted the alicewasko/generators-metadata branch January 31, 2024 03:28
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