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

Store current Skosmos version in composer.json #1308

Merged
merged 3 commits into from
Apr 27, 2022

Conversation

osma
Copy link
Member

@osma osma commented Apr 26, 2022

Reasons for creating this PR

Skosmos has been using git tags to infer the current version, which is shown on the About page and in the Generator field in the embedded HTML metadata. This has never worked on Docker containers (which don't have access to the full git repository) and recently it has been broken also in some regular installs.

This PR implements another mechanism, suggested by @kinow in #1202, where the version number is kept in composer.json and read via the Composer runtime API. This ensures that the version information is always available. On the downside, it requires some manual housekeeping to make sure that the version in composer.json is up to date. For now, I think we will do this manually. There are tools that can automate this (see #1202 (comment)) but they didn't look very promising. I will add the necessary steps to the Release Process documentation. I also added a unit test that verifies that the version from composer.json matches the version determined from git tags.

Link to relevant issue(s), if any

Description of the changes in this PR

  • add version number (here, 2.15-dev - I don't think the v prefix is necessary) to composer.json
  • use Composer runtime API to access the version number, instead of git operations
  • add a unit test that verifies that the version from composer.json matches version determined using git tags
  • adjust GitHub Actions configuration so that git version history (including tags) is checked out from the repo, so that the above test has a chance to succeed

Known problems or uncertainties in this PR

I hope the new processes around release will work out well, but we'll find out soon.

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if not, explain why below)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma added this to the 2.15 milestone Apr 26, 2022
@osma osma self-assigned this Apr 26, 2022
@sonarcloud
Copy link

sonarcloud bot commented Apr 26, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Apr 26, 2022

Codecov Report

Merging #1308 (c783e96) into master (e6ec026) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #1308      +/-   ##
============================================
- Coverage     69.45%   69.44%   -0.02%     
+ Complexity     1657     1656       -1     
============================================
  Files            32       32              
  Lines          4070     4068       -2     
============================================
- Hits           2827     2825       -2     
  Misses         1243     1243              
Impacted Files Coverage Δ
model/Model.php 80.81% <100.00%> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6ec026...c783e96. Read the comment docs.

@osma
Copy link
Member Author

osma commented Apr 26, 2022

I updated the Release Process documentation, see diff

Copy link
Collaborator

@kinow kinow left a comment

Choose a reason for hiding this comment

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

Updated release docs look good, change looks good, tested with Docker Compose locally, all good! 🎉

image

I think great part of the release process can be automated in GH Actions, another dev did an amazing work at Cylc (previous $work) using plain GH Actions 1 and some custom actions (Node.js) 2. It can even generate PR's to be reviewed and include things like a Release Message 3. For some day.

Footnotes

  1. https://github.com/cylc/cylc-flow/blob/master/.github/workflows/1_create_release_pr.yml & https://github.com/cylc/cylc-flow/blob/master/.github/workflows/2_auto_publish_release.yml

  2. https://github.com/cylc/release-actions

  3. https://github.com/cylc/cylc-flow/pull/4753

@osma
Copy link
Member Author

osma commented Apr 27, 2022

Thanks for the review @kinow ! I will merge this.

Thanks also for the tips on release automation, this is very helpful and interesting. I'll open another issue to track those ideas. We've had similar discussions about automating parts of the release process, but for now I think it's best to do that manually.

@osma osma merged commit 1895bdf into master Apr 27, 2022
@osma osma deleted the issue1202-skosmos-version-from-composer.json branch April 27, 2022 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skosmos version not showing in Docker install
2 participants