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

Add auto-layer-releases flow to deploy flow #1274

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

Conversation

hmstepanek
Copy link
Contributor

Overview

Move auto-layer-releases flow from lambda to GHA.

Move auto-layer-releases flow from lambda to GHA.
@hmstepanek hmstepanek requested a review from a team as a code owner December 16, 2024 20:15
Copy link

github-actions bot commented Dec 16, 2024

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
✅ YAML prettier 1 0 0 0.43s
❌ YAML v8r 1 1 1.72s
✅ YAML yamllint 1 0 0.27s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.36%. Comparing base (25e1f1e) to head (da7cac0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1274      +/-   ##
==========================================
- Coverage   79.55%   79.36%   -0.19%     
==========================================
  Files         201      201              
  Lines       22173    22173              
  Branches     3519     3519              
==========================================
- Hits        17639    17597      -42     
- Misses       3379     3431      +52     
+ Partials     1155     1145      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -0,0 +1,70 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#!/bin/bash
#!/usr/bin/env python3

Comment on lines 19 to 38
# How to use this script:
# Set the following env vars:
# * GH_RELEASE_TOKEN
# * LAMBDA_RUNTIME (optional)
# * INITCONTAINER_RUNTIME (optional)
# * AGENT_VERSION
# * DRY_RUN (optional) set to 1 to run the flow without creating the release tag.
#
# Lambda runtime options:
# nodejs
# python
# ruby
# dotnet
#
# Initcontainer runtime options:
# nodejs
# python
# ruby
# java
# dotnet
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't you make those a constant, so we don't have to set those as env vars? Presumably each repo will have a separate copy of this script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well...I was still thinking of making it shared at this point (even though I realize I haven't done that in this PR). I guess TBD on that.

Comment on lines 59 to 60
tag_name = f"{latest_version}.0_{runtime}"
release_name = f"New Relic {runtime} Agent {latest_version}.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

This originally had logic to have release names and release tags as different strings. For Python the only difference was capitalization, but for Node and .NET it was Node -> nodejs, and .NET -> dotnet.

Why not make constants for TAG_SUFFIX="python" and RUNTIME_NAME="Python". Then maybe use bool constants to toggle on/off the lambda and initcontainer releases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oooh you're totally right! I was trying to simplify those out but they were used for the release name-I'll put those back I guess. Instead of a boolean I was thinking each team could just set the value of those and that way the work flow could be shared across all teams-I need to look into that more though to see if we can do that.

@TimPansino
Copy link
Contributor

As a general thought, is there a reason not to convert this to bash scripting and use the gh CLI? Seems like it would be easier for other teams to manage, and we could then just add the code directly into the release flow as a step.

@hmstepanek
Copy link
Contributor Author

As a general thought, is there a reason not to convert this to bash scripting and use the gh CLI? Seems like it would be easier for other teams to manage, and we could then just add the code directly into the release flow as a step.

I was actually thinking about this after I pushed this up as a Python script. Since we seem to both have had that thought, I'll just go ahead and do that. I agree-it would be easier to maintain that way for each team in the long run.

@hmstepanek hmstepanek force-pushed the add-layers-release-flow-to-gha branch from ad59deb to 30b2816 Compare December 17, 2024 23:12
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.

3 participants