-
Notifications
You must be signed in to change notification settings - Fork 411
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
Create automation script to update project version numbers across repos. #1128
Comments
Just had a question on who would run the script periodically? Would it be automated through a github action in this repo, would it be an automation on some server hosted by PL, or would someone, run the script locally and then push the changes as a pr? As I see it, (quickly glanced through the docs) the pages that would need to be altered in the case of a version update, would be those in "/ipfs-docs/docs/install" is that correct? Before talking about the script, there could be a Markdown hack that we could use to make this easier. "variables" in Markdown So the whole process would look something like:
This way it still keeps the portability aspect and the script does not have to go parse the whole document. The changes would be minimal to each doc site |
Yeah this is likely the best option. Well this is cool! But I wonder if it'd work within codeblocks:
Your process seems logical. We'd probably be able to use the GitHub api to check releases for each major repo (Go-IPFS, IPFS Updater, etc). |
So I downloaded the repo and made some basic changes. Turns out the "variable" idea still only behaves like url links
And it also did not work with codeblocks, it just rendered it literally like So if the vue variables is not an option, then the script would have to parse every line in the doc 😟
Looks like that would be simple enough with: |
Ok nice, so something like: curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/ipfs/go-ipfs/releases/latest | jq ".tag_name" Gives us: "v0.12.2" Then we just need some funky regex to run on certain pages to find and replace. This python should work: import re
regex = r"v\d{1,2}\.\d{1,2}\.\d{1,2}"
test_str = ("---\n"
"title: Command-line\n"
"description: Using IPFS through the command-line allows you to do everything that IPFS Desktop can do, but at a more granular level since you can specify which commands to run. Learn how to install it here.\n"
"current-ipfs-version: v0.12.2\n"
[...]
)
subst = "\"v0.12.2\""
result = re.sub(regex, subst, test_str, 0, re.MULTILINE)
if result:
print (result) Haven't tested this though. |
It did work, but I had to remove the
Then I changed
I can try extending the script to a given page.
I'll start with the ipfs-updater tool, and I won't add anything to the metadata(?, idk what that top portion is called) just yet, but that is perfect to have. Then the next step would be checking against the API and running the script if needed. Which I can also take care of. |
I've added the script to PR #1130. Just need to link it up to GitHub actions and we're good to go! Should probably get a Python wiz to review it to (I'm just a lowly docs guys; programming is not my forte). |
lol now worries. I program well in python, but stackoverflow is our best friend too 😅 |
go-ipfs triage notes (cc @BigLep)
|
Sure, @mrodriguez3313 @johnnymatthews thanks for looking into this! |
Thanks @laurentsenta . Please proceed with any path that reduces the manual steps here :). Thank you! |
Throughout this repo we reference specific version numbers for things like Go-IPFS and IPFS Updater.
The problem is that where there's updates to these applications, we have to manually go through this repo and update any references. It'd be nice if we had a script that:
We can use this issue to discuss the best way of creating this script.
The text was updated successfully, but these errors were encountered: