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

Rework Actions to Run on Candidate Release Artifacts #1546

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dricross
Copy link
Contributor

Description of the issue

The CloudWatch Agent candidate release artifacts (which are the real artifacts that will released to the public via s3/ecr) are created outside of the standard GitHub workflow. We'd like to be able to run the integration tests on those artifacts prior to a public release.

Description of changes

  • New workflow Test Artifacts: generalization of the existing Run Integration Tests workflow but can accept github SHA or candidate release build version number (e.g. 1.300052.0b1024). Notably does not have the CheckBuildArtifacts step since that wouldn't apply for candidate release artifacts.
  • New workflow Test Release Candidate which has the following major steps:
    • Repackage: Repackage release candidate artifacts to match how the Build Artifacts workflow sets up the artifacts in preparation for Run Integration Test
      • Pull candidate release artifacts from release candidate s3 bucket, re-upload to integration test s3 bucket using the build version (e.g. 1.300052.0b1024) in place of the GitHub sha
      • Pull candidate release agent image and push to integration test ECR repo
    • Test Artifacts: run integration tests on the repackaged candidate release artifacts
  • Updated Run Integration Tests workflow:
    • This is now a small shim
    • Verifies input arguments then runs Test Artifacts as a reusable workflow
    • Can accept a override for the test branch to use (useful when creating new integration tests that don't need an agent update)
    • One downside is that is workflow looks a bit different. Everything is under one fold group labeled Test Artifacts instead now
  • Replaced the set-output since it's deprecated: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

GitHub actions are restricted to 5 nested workflow calls which complicates some thing.

  • Build Test Artifacts already makes a gh workflow call to Run Integration Tests
  • Test Release Candidate makes a gh workflow call to Test Artifacts

I am open to restructuring how some of these things are called. It might be desirable to be consistent and always do a gh workflow call to Test Artifacts but that would require ditching the CheckBuildArtifacts step after the gh workflow call as part of the Build Test Artifacts workflow.

I chose to repackage the existing release artifacts to mimic the format of Build Test Artifacts so that there were no changes to the test repo. All the terraform scripts work exactly the same.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

@dricross dricross requested a review from a team as a code owner February 11, 2025 19:22
Comment on lines -95 to -114
-var="ssh_key_value=${{env.PRIVATE_KEY}}" \
-var="github_test_repo=${{ inputs.test_repo_url }}" \
-var="test_name=${{ matrix.arrays.os }}" \
-var="cwa_github_sha=${{inputs.github_sha}}" \
-var="install_agent=${{ matrix.arrays.installAgentCommand }}" \
-var="github_test_repo_branch=${{inputs.test_repo_branch}}" \
-var="ec2_instance_type=${{ matrix.arrays.instanceType }}" \
-var="user=${{ matrix.arrays.username }}" \
-var="agent_start=${{ matrix.arrays.agentStartCommand }}" \
-var="ami=${{ matrix.arrays.ami }}" \
-var="ca_cert_path=${{ matrix.arrays.caCertPath }}" \
-var="arc=${{ matrix.arrays.arc }}" \
-var="binary_name=${{ matrix.arrays.binaryName }}" \
-var="ca_cert_path=${{ matrix.arrays.caCertPath }}" \
-var="cwa_github_sha=${{inputs.build_id}}" \
-var="ec2_instance_type=${{ matrix.arrays.instanceType }}" \
-var="excluded_tests='${{ matrix.arrays.excludedTests }}'" \
-var="github_test_repo=${{ inputs.test_repo_url }}" \
-var="github_test_repo_branch=${{inputs.test_repo_branch}}" \
-var="install_agent=${{ matrix.arrays.installAgentCommand }}" \
-var="local_stack_host_name=${{ inputs.localstack_host }}" \
-var="plugin_tests='${{ github.event.inputs.plugins }}'" \
-var="region=${{ inputs.region }}" \
-var="s3_bucket=${{ inputs.s3_integration_bucket }}" \
-var="plugin_tests='${{ github.event.inputs.plugins }}'" \
-var="excluded_tests='${{ matrix.arrays.excludedTests }}'" \
-var="ssh_key_name=${{env.KEY_NAME}}" \
-var="ssh_key_value=${{env.PRIVATE_KEY}}" \
-var="test_dir=${{ matrix.arrays.test_dir }}" \
-var="agent_start=${{ matrix.arrays.agentStartCommand }}"; then terraform destroy -var="region=${{ inputs.region }}" -var="ami=${{ matrix.arrays.ami }}" -auto-approve
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 is all just alphabetizing/formatting

Copy link
Contributor

@okankoAMZ okankoAMZ left a comment

Choose a reason for hiding this comment

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

Looks good

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