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

Governance: Automatically calculate the current version number through Git #537

Closed
elliotxx opened this issue Jul 17, 2024 · 11 comments · Fixed by #544
Closed

Governance: Automatically calculate the current version number through Git #537

elliotxx opened this issue Jul 17, 2024 · 11 comments · Fixed by #544
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@elliotxx
Copy link
Collaborator

What would you like to be added?

Automatically calculate the current version number through Git.

For example, assuming the latest tag is v0.4.2, if HEAD is equal to v0.4.2, then the version number is v0.4.2. If not equal, the version number is v0.4.3-xxxxxx, among them, xxxxxx is ${shortSha}.

Why is this needed?

The current version number is hardcode in the pkg/version/VERSION file, and its value needs to be manually modified before each new version is released, which is not conducive to long-term maintenance.

@elliotxx elliotxx added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 17, 2024
@rajeshkio
Copy link
Contributor

Could you please confirm if this issue is still open and if I can start working on it?

@elliotxx
Copy link
Collaborator Author

@rajeshkio Yeah, this issue is currently not aasign to anyone. Welcome to claim it! Maybe you need to know some background of this feature. #362

@elliotxx elliotxx added this to the v0.6.0 milestone Jul 25, 2024
@rajeshkio
Copy link
Contributor

Thank you. I checked it. My idea is to create a directory 'scripts' and add a script to find the version number and update the pkg/version/VERSION. Is this the right approach or can you recommend any other way.

@elliotxx
Copy link
Collaborator Author

@rajeshkio I have an idea that has been validated in production here for your reference. The following example can generate version information and some git helpers, which should help you quickly implement this issue.

@rajeshkio
Copy link
Contributor

ohh it looks like most of the things are already done. Let me try to build and see what is missing.

@elliotxx
Copy link
Collaborator Author

@rajeshkio Yes, some basic libraries can be reused. Looking forward to your PR!

@rajeshkio
Copy link
Contributor

one silly question maybe. Should I directly import your libraries and use them or should I create new files with almost similar contents for this repo?

@elliotxx
Copy link
Collaborator Author

@rajeshkio Importing library go-web-template is not suitable. Can be directly copied into the project.

@rajeshkio
Copy link
Contributor

Thought so. I will use the same structure and add or remove contents as needed.

@elliotxx
Copy link
Collaborator Author

@rajeshkio No problem, you can integrate according to actual needs. 👍

rajeshkio added a commit to rajeshkio/karpor that referenced this issue Jul 25, 2024
…usionStack#537

 /kind feature

 ## What this PR does / why we need it:

 Automates versioning and updates pkg/version/VERSION file
@elliotxx
Copy link
Collaborator Author

@rajeshkio Hi, I have created a new issue #560 for future optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants