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

VACMS-16476: production tag workflow #336

Merged
merged 17 commits into from
Jan 17, 2024

Conversation

timcosgrove
Copy link
Contributor

@timcosgrove timcosgrove commented Jan 12, 2024

Description

Relates to department-of-veterans-affairs/va.gov-cms#16476

Testing done

This was tested by running the workflow against the Next Build repo to generate tags. There were a number of both unsuccessful and successful runs, all of which can be seen here: https://github.com/department-of-veterans-affairs/next-build/actions/workflows/production-tag.yml

The resulting tags are here: https://github.com/department-of-veterans-affairs/next-build/tags
Every tag after the first one was created by this workflow.

Both success and failure are being reported into this Slack channel: https://dsva.slack.com/archives/C06DSBT7CBW

Screenshots

QA steps

There is not a good way to test this without enabling the workflow for Pull Request events; this is how the testing/development was done in the first place. I would recommend reviewing the workflow runs to see how the workflow played out.

There are also explanatory comments on the file itself.

Tasks

Preview Give feedback

Is this PR blocked by another PR?

  • Add the DO NOT MERGE label
  • Add links to additional PRs here:

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 18:45 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 20:46 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 21:00 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 21:16 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 22:18 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 22:21 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 22:26 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 22:47 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 23:02 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 23:08 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 23:21 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 23:29 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 12, 2024 23:36 Destroyed
@@ -0,0 +1,128 @@
name: Create Production Tag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This based on the Content Build Daily production release (tag), with some (IMHO) improvements and changes.

https://github.com/department-of-veterans-affairs/content-build/actions/runs/7506884417/workflow

@@ -0,0 +1,128 @@
name: Create Production Tag

on:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This intention here is that 2 things will trigger a new production tag:

  • manual tagging (this is a backup)
  • a completed successful run of the CI workflow on the main branch

This is to get away from daily timed tagging and enable more continual deployment with tests in place to ensure application integrity.

name: Create Production Tag
runs-on: ubuntu-latest
# Run the workflow unless it was triggered by CI and that failed
if: ${{ !(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot prevent a failed but completed CI run from triggering the workflow, so we have this here to prevent the tagging from running if it was a failure.

id: get-latest-tag
run: echo LATEST_TAG_VERSION=$(git fetch --all --tags > /dev/null && git tag -l | sort -V --reverse | head -n 1) >> $GITHUB_OUTPUT

- name: Get next tag version
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was reworked some from the Content Build version, which assumes the numbering scheme will always be v0.0.123 or some other number on the end. The rework expects a semver-type version (3 numbers separated by . but otherwise makes no assumptions about the incoming tag structure.

It will output the same tag structure with the point version incremented by 1.

@timcosgrove timcosgrove marked this pull request as ready for review January 16, 2024 20:44
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 16, 2024 20:44 Destroyed
@timcosgrove timcosgrove changed the title DNM: VACMS-16476: production tag workflow VACMS-16476: production tag workflow Jan 17, 2024
@timcosgrove timcosgrove merged commit 32143be into main Jan 17, 2024
7 checks passed
@timcosgrove timcosgrove deleted the VACMS-16476-production_tag_workflow branch January 17, 2024 16:48
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.

3 participants