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

Task: Automatically update CodeMeta upon release #1276 #1288

Conversation

OlawumiSalaam
Copy link
Contributor

@OlawumiSalaam OlawumiSalaam commented Oct 3, 2024

Thank you for taking your time to contribute to Ersilia, just a few checks before we proceed

  • Have you followed the guidelines in our Contribution Guide
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Description

This task is to update the existing GitHub Actions workflow for the Ersilia project by automating the update of the version number in the codemeta.json file during the monthly release process. The existing workflow already updates the version in CITATION.cff, and this task ensures that the same version number is also updated in codemeta.json for consistency across project metadata files.
Ersilia has an automatic release trigger on the first day of each month at 3:00 AM (UTC). The workflow manages the following:

  • Incrementing the version number in the pyproject.toml file.
  • Creating and pushing a new release tag to the repository.
  • Updating the version number in CITATION.cff.
  • Publishing the release to GitHub, PyPI, Conda, and DockerHub.

This task adds a new step to ensure that the version in codemeta.json is updated to match the incremented version number.

Changes to be made

  • A new step was introduced into the existing GitHub Actions workflow to update the version number in the codemeta.json file using the extracted version number. This ensures that the version field in this file remains consistent with the version number used for releases.
  • The version number is updated programmatically using jq, a command-line JSON processor used to manipulate the JSON file. The jq command reads the existing codemeta.json file, updates the version field with the new version number stored in the VERSION environment variable, and writes the updated content back to codemeta.json.
  • The CITATION.cff and codemeta.json files are committed and pushed to the repository in a single step, which ensures that the version is updated in both files. This ensures the files are updated before proceeding with the rest of the release process.

Status

  • A new step introduced in the workflow to automatically update the version in the CodeMeta file.
  • Pushed changes to the feature/update-codemeta-upon-release branch for review.

To do

  • Run tests locally to verify the functionality.
    -when i tried to run locally, I encountered error:
    "fatal: could not read Username for 'https://github.com/': No such device or address,"

Is this pull request related to any open issue? If yes, replace issueID below with the issue ID
Yes,
Closes #1276

@OlawumiSalaam
Copy link
Contributor Author

@DhanshreeA kindly check and provide feedback.
Thank you.

@P-Mefut
Copy link

P-Mefut commented Oct 3, 2024

Hi @OlawumiSalaam nice but you haven't made changes to update the URL yet when changes to the version are done

@OlawumiSalaam
Copy link
Contributor Author

@P-Mefut Thank you for your feedback. I will check again and implement.

@OlawumiSalaam
Copy link
Contributor Author

I implemented the feedback regarding the URL in the codemeta.json

.github/workflows/publish.yaml Outdated Show resolved Hide resolved
.github/workflows/publish.yaml Outdated Show resolved Hide resolved
.github/workflows/publish.yaml Show resolved Hide resolved
.github/workflows/publish.yaml Outdated Show resolved Hide resolved
@DhanshreeA
Copy link
Member

LGTM generally @OlawumiSalaam! I really like how you took the time to clean up some of the existing code. :)

@OlawumiSalaam
Copy link
Contributor Author

@DhanshreeA thank you for the feedback. I will incorporate your feedback. Thank you.

@OlawumiSalaam
Copy link
Contributor Author

@DhanshreeA I have reviewed and implemented your feedback through the following steps:
I removed this line from the workflow:
git push "${repo}" origin "v${{ steps.version.outputs.VERSION }}"
I updated the message to reflect there are several files being updated:
"update message"
I added a comment to explain the files that are being updated by the cron job:
_This job updates static_version.py, pyproject.toml, CITATION.cff, and codemeta.json
I kept the line unchanged for now and stated my observations:
version=sed -n 's/.version = "([^"])".*/\1/p' _static_version.py
observations:
In the version job, we are extracting the version using the static_version_writer.py script and we are also using sed to download the _static_version.py again. This can cause redundancy, we can consider using the version extracted in the version job and pass it as an output throughout the pipeline.

@OlawumiSalaam
Copy link
Contributor Author

@DhanshreeA Please review and I awaits your further feedback. Thank you.

@OlawumiSalaam
Copy link
Contributor Author

@DhanshreeA please I am waiting for your feedback on the updated task. Thank you

with:
author_name: "ersilia-bot"
author_email: "ersilia-bot@users.noreply.github.com"
message: "update version [skip ci]"
message: "Update version"
Copy link
Member

Choose a reason for hiding this comment

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

@OlawumiSalaam we do need to keep [skip ci] in the commit message.

@OlawumiSalaam
Copy link
Contributor Author

@DhanshreeA Thank you for your review and I have implemented your feedback. Can I work on another issue

@DhanshreeA
Copy link
Member

@DhanshreeA Thank you for your review and I have implemented your feedback. Can I work on another issue

Yes please go ahead, thank you!

@DhanshreeA
Copy link
Member

Hi @OlawumiSalaam nice but you haven't made changes to update the URL yet when changes to the version are done

Good catch @P-Mefut!

@DhanshreeA DhanshreeA merged commit 3235e15 into ersilia-os:master Oct 10, 2024
18 checks passed
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.

🐈 Task: Automatically update CodeMeta upon release
3 participants