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

fix: display correct app version in dhis2 and updated workflows #3061

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

jenniferarnesen
Copy link
Collaborator

@jenniferarnesen jenniferarnesen commented Aug 23, 2024

I set this to a fix, because after this is released, user will see the correct app version in dhis2.

PR workflow: verify-pr.yml
This workflow triggers on pull request actions only. It verifies that the PR code passes build, lint, test, and e2e.

Release workflow: release.yml
This workflow only runs on pushes to the master branch since this is the only release branch. Every release involves 2 commits to master:

  • squash merging the PR
  • the release workflow pushes a new commit with version change in package.json and CHANGELOG.md, e.g. the [skip release] commit

The release workflow triggers for both pushes to master listed above. But we only want the the release job to run for the first push.

The semantic-release workflow steps are found in .releaserc. Previously @dhis2/action-semantic-release was used but this was overkill for our needs and difficult to make changes to. Therefore, we created our own semantic-release steps in .releaserc:

  • commit-analyzer: Determines the next app version
  • release-notes-generator: Generates the new release notes
  • changelog: Updates CHANGELOG.md with the generated release notes
  • npm: Updates package.json with the new version number. Does not publish to npm since private: true in package.json
  • exec: Runs yarn build which updates all version number references in the bundle
  • git: creates commit number "2" (mentioned above) with just CHANGELOG.md and package.json and pushes it to the remote
  • github: pushes the bundle to the github repo as a new release and adds a tag

After semantic-release is complete, the bundle is then published to AppHub so that it is actually available to all users. Because of the addition of the exec yarn build step, all references to the version in the bundle should be the same, thus fixing the annoying bug where the old version displays in the instance after installing the later version.

If any point in the release fails, then a failure message is sent to slack. If the release step succeeds, then a success message is posted to slack that includes the new version number and the release notes.

Publish to d2-ci: publish-to-d2-ci.yml
This workflow publishes the build to d2-ci in the following cases:

The [skip release] commit on master

  • Git tags
  • Fail message is sent to slack if the publish failed

@jenniferarnesen jenniferarnesen changed the title chore: updated workflows chore: updated github workflows Aug 23, 2024
@jenniferarnesen jenniferarnesen changed the title chore: updated github workflows chore: separate workflows for prs releases and tags Aug 23, 2024
@dhis2-bot
Copy link
Contributor

dhis2-bot commented Aug 23, 2024

🚀 Deployed on https://pr-3061--dhis2-dashboard.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify August 23, 2024 11:29 Inactive
@jenniferarnesen jenniferarnesen changed the title chore: separate workflows for prs releases and tags fix: display correct app version in dhis2 and updated workflows Aug 23, 2024
@dhis2-bot dhis2-bot temporarily deployed to netlify August 23, 2024 12:09 Inactive
@jenniferarnesen jenniferarnesen added the e2e record Apply this label to a pull request to trigger recording of E2E tests on Cypress Cloud label Aug 23, 2024
Copy link

cypress bot commented Aug 23, 2024

dashboards-app    Run #4964

Run Properties:  status check failed Failed #4964  •  git commit 8c23a0a917 ℹ️: Merge 39a0652226454bdc4488946829f5ef0df48cd22f into c12e71cb6bc741546b57f1ae06fb...
Project dashboards-app
Branch Review chore/new-gh-workflows
Run status status check failed Failed #4964
Run duration 05m 17s
Commit git commit 8c23a0a917 ℹ️: Merge 39a0652226454bdc4488946829f5ef0df48cd22f into c12e71cb6bc741546b57f1ae06fb...
Committer Jen Jones Arnesen
View all properties for this run ↗︎

Test results
Tests that failed  Failures 3
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 3
Tests that passed  Passing 8
View all changes introduced in this branch ↗︎

Tests for review

Failed  dashboard_filter.feature • 2 failed tests • e2e-chrome-parallel-2.40-1

View Output Video

Test Artifacts
Dashboard filter > I add a Organisation unit filter Test Replay Screenshots Video
Dashboard filter > I add a Facility Type filter Test Replay Screenshots Video
Failed  view_errors.feature • 1 failed test • e2e-chrome-parallel-2.40-1

View Output Video

Test Artifacts
Errors while in view mode > Starring a dashboard fails Test Replay Screenshots Video

@jenniferarnesen jenniferarnesen merged commit 69b8425 into master Aug 23, 2024
59 of 65 checks passed
@jenniferarnesen jenniferarnesen deleted the chore/new-gh-workflows branch August 23, 2024 13:54
dhis2-bot added a commit that referenced this pull request Aug 26, 2024
## [100.2.4](v100.2.3...v100.2.4) (2024-08-26)

### Bug Fixes

* add missing dependencies for semantic-release ([#3062](#3062)) ([9fe6ae5](9fe6ae5))
* display correct app version in dhis2 and updated workflows ([#3061](#3061)) ([69b8425](69b8425))
* stop fetching schemas and replace d2 with dataEngine ([#3056](#3056)) ([49428c6](49428c6))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.2.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e record Apply this label to a pull request to trigger recording of E2E tests on Cypress Cloud released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants