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

Generate repos.json via workflow #54

Closed
wants to merge 8 commits into from

Conversation

willuhmjs
Copy link
Contributor

@willuhmjs willuhmjs commented Apr 28, 2023

Uses a GitHub Action to automatically update repos.json with a Deno script. Blazing fast and super safe!

Fixes #51.

@willuhmjs
Copy link
Contributor Author

@ctubbsii What is code.json used for, and what GitHub API endpoint is used to generate it?

@ctubbsii
Copy link
Contributor

@ctubbsii What is code.json used for, and what GitHub API endpoint is used to generate it?

That file is used to feed into the software inventory at https://code.gov/ . You can read more about it there, but I think one of the main goals is to make software that is funded and produced by one government agency available to others, to promote cost savings across the government, rather than different agencies waste taxpayer funds to reinvent existing solutions.

As for how it is produced, there are probably some tools at https://code.gov/, but I don't know if we're using that or some other custom tools. I would have to investigate. In the past, my part had been to help format the files that were produced by somebody else who was responsible for generating them (as in, for example, #36). I've used pygithub in the past... I'm not sure which endpoints we'd need for this, though. I'd check at https://code.gov/ first to see if there's good existing tools for producing the json.

@willuhmjs willuhmjs changed the title Generate repos.json and code.json via workflow Generate repos.json via workflow Apr 29, 2023
@willuhmjs
Copy link
Contributor Author

Since the code.json schema is maintained by the GSA, I have limited the scope of this PR.

@willuhmjs willuhmjs marked this pull request as ready for review April 29, 2023 21:30
Copy link
Contributor

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

@willuhmjs I appreciate your enthusiasm to help out here, but we have a lot of constraints about the kinds of things we can trust to be added here, and I think we're going to need to review our own scripts for generating updates here, because have a lot of additional considerations to make that you can't get from the GitHub API (like the supplemental repos.json file I mentioned in the comment below).

Comment on lines +17 to +22
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Run deno grab action
run: deno task grab
- uses: stefanzweifel/git-auto-commit-action@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, but running 3rd party GitHub Actions tasks is basically a non-starter... for the same reasons we couldn't approve of the binary images. We can't really trust 3rd party code running on our repos, especially with permission to alter their contents, as this would necessarily need to do.

The code that would need to run would have to be included in this repo, or use standard GitHub.com created actions (or equally respected and widely used, like the ruby/ actions).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you consider as "equally respected and widely used?" Would Node.js work instead of Deno? If so, I can easily modify the code to use Node.js instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, all the code that runs on the project and alters the project is contained within this repo. The GitHub Actions could run a python script checked into this repo, for example. I would prefer basic shell scripts (bash) or python, because we need to keep it to something that most developers could maintain, and not do anything too niche. Lowering the barrier to maintenance is the best way to ensure that we'll be able to keep this maintained, when people switch jobs, move positions, prioritize other projects, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

There are a lot of changes to this file. This file is intended to supply additional information about our publicly available software that is published to other locations, so that the information can be still be collected and placed in the generated code.json file. Removing those entries should not be done at all.

Copy link
Contributor Author

@willuhmjs willuhmjs May 1, 2023

Choose a reason for hiding this comment

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

Modifying the script to fetch from other locations wouldn't be difficult to do. What are the other sources?

Copy link
Contributor

Choose a reason for hiding this comment

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

@willuhmjs The repos.json is supposed to contain the metadata for that. But, I'm not sure how that file itself is updated. This is something we would need to do internally. I don't think this is something an outside contributor can contribute.

@ctubbsii
Copy link
Contributor

ctubbsii commented May 1, 2023

I think I need to close this PR for now. I do not think that we're going to be able to keep this updated with anything contributed from outside. We have used a python script internally to keep these things up-to-date. I need to work with the internal folks who have run that to get that added to this repo. Once that is done, then we can automate it. Until then, we should leave it as is.

@ctubbsii ctubbsii closed this May 1, 2023
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.

Dynamically generate repos.json
2 participants