-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Automatic generation of README catalogs #737
Conversation
The `README.md` tables of the catalog of CLIs and apps might become out of sync from time to time. It should be automatically generated and fail build in case not committed. Using `cog` https://nedbatchelder.com/code/cog/ , the `README.md` file can be generated and overwrite itself by calling - `arkade install --print-table` - `arkade get --output markdown` The Github Action workflows were updated accordingly to run the `make lint` as part of the job, in order to verify calling `make docs` does not make any changes to the repoisotry that weren't commited to git. Add `${PWD}/${BIN}` to the Makefile in order to use the latest `arkade` that was generated by `make dist`. Bugfix `arkade install --print-table` to be key ordered (otherwise everytime it produces a different table). Signed-off-by: Yuval Goldberg <[email protected]>
First of all I like the general idea of auto-updating the readme, for that we eventually need to build better tooling for sure! But tbh, we could solve something like this with basic unix tooling like I assume that if we want to run this locally, we need to install python and install this python package globally with pip, like you did in the CI update, right? But that's only my two cents. What do you think @alexellis ? |
Thanks @Shikachuu . I understand that it requires more dependencies. Honestly Another suggestion, if you want, I can make it encapsulated inside a docker container, so you won't be required to have Python nor Please let me know what do you prefer. :) |
Hey @YuviGold, Thanks for the detailed reply! I understand the concern from your side about If you insist, I think the later is better, using But let's see what the others think about this. |
- name: "Set up Python" | ||
uses: "actions/setup-python@v4" | ||
with: | ||
python-version: '3.10' |
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.
In my opinion, a CI job is not the correct place to regenerate a README file, which needs to be committed back into the tree.
This should be a task that contributors run with PRs, and part of the PR template.
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.
In my opinion, a CI job is not the correct place to regenerate a README file, which needs to be committed back into the tree.
This should be a task that contributors run with PRs, and part of the PR template.
+1 on this, that's why I asked about how to run this locally!
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.
The idea behind it was that the CI would rerun the generation script (make lint
that calls make docs
) and verify no changes weren't committed to git.
Of course it can be removed from the publish
GHA
+1 to this, it can probably be achieved with a Makefile, or some Go code in the repo that can be run separately from arkade. When solving a new problem, we want input from maintainers and the person proposing the solution, before making a firm technical decision like this. We also need to decide whether we are bothered enough by the problem to spend time on it, because whatever we do now will need to be explained and maintained going forward also. |
@alexellis @Shikachuu
IMHO Go is not built for small scripts like that. But sure I can think of other solutions as well. Let me know how you would like to proceed. :) |
I would prefer to continue this discuisson in the issue and close this PR since we don't have a common ground about the implementation. |
Description
Resolves #736
The
README.md
tables of the catalog of CLIs and apps mightbecome out of sync from time to time.
It should be automatically generated and fail build in case not committed.
Using
cog
https://nedbatchelder.com/code/cog/ , theREADME.md
filecan be generated and overwrite itself by calling
arkade install --print-table
arkade get --output markdown
The Github Action workflows were updated accordingly to run the
make lint
as part of the job, in order to verify callingmake docs
does not make any changes to the repoisotry that weren't commited to
git.
Add
${PWD}/${BIN}
to the Makefile in order to use the latestarkade
that was generated by
make dist
.Bugfix
arkade install --print-table
to be key ordered (otherwiseeverytime it produces a different table).
Motivation and Context
design/approved
by a maintainer (required)How Has This Been Tested?
➜ arkade git:(cog-generate-readme) sed -i 's/terraform/terra/g' ./pkg/get/tools.go
As you can see, the
README.md
file was updated, but wasn't committed to git.In addition, locally using https://github.com/nektos/act to call the repository Github Actions.
Are you a GitHub Sponsor yet (Yes/No?)
Types of changes
Documentation
./arkade get -o markdown
./arkade install --help
Checklist:
git commit -s