kevincobain2000 / gobrew

Go version manager, written in Go. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.
https://medium.com/web-developer/go-version-manager-gobrew-c8750157dfe6
MIT License
358 stars 24 forks source link

Improve golang-tags.json #168

Closed juev closed 7 months ago

juev commented 7 months ago

We save the full content for json with tags: https://github.com/kevincobain2000/gobrew/blob/master/.github/workflows/sync-release-tags.yml#L16

But then we use only one field from it, ref: https://github.com/kevincobain2000/gobrew/blob/master/helpers.go#L395

Maybe at the moment when we request json, we can immediately carry out the necessary checks and transformations?

https://github.com/kevincobain2000/gobrew/blob/master/helpers.go#L400

Should we remove the "refs/tags/" prefix, check that the tag starts with "go", and only then save a specific version?

In the code, we will still need to read and process json, but we will not need to process unnecessary data and send data over the network that we do not use.

Moreover, less data can be stored in the repository.

By the way, maybe for synchronization, create a separate repository and link to it? By getting rid of a separate branch in the current repository? This will allow you to get rid of the data synchronization workflow startup logs. And again reduce the size of the repository itself.

What do you think?

juev commented 7 months ago

I thought here that, as an example, we can add a new command to gobrew, the call of which will parse json from Github and display a new json, which will contain only golang versions.

Then, in a separate repository, set up a periodic call to gobrew with a new command and commit the result to the master branch.

After which we can change the link in gobrew itself from which we get the golang versions. And remove additional parsing.

kevincobain2000 commented 7 months ago

Hi. Thanks for the suggestion. I agree with reducing the parsed json, to just that json kv, that we need. Having those to all together a different repository complicate things. Having all in one repo is more manageable.

juev commented 7 months ago

I think I can provide changes after we check and commit: https://github.com/kevincobain2000/gobrew/pull/167

juev commented 7 months ago

Another thought came to mind: use a gist, not a repository, to store the json file https://docs.github.com/en/rest/gists/gists?apiVersion=2022-11-28

In principle, it is quite easy to implement.

kevincobain2000 commented 7 months ago

I mean. Idk man. It works just fine right now.

juev commented 7 months ago

OK, thanks. :)

kevincobain2000 commented 7 months ago

Also. Idk but you are on fire. So many contributions.