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

track github action deploys #1679

Merged
merged 4 commits into from
Jul 23, 2024
Merged

track github action deploys #1679

merged 4 commits into from
Jul 23, 2024

Conversation

sunkickr
Copy link
Contributor

Description

This change will make the header for client github-action for all requests the CLI makes within a github action workflow. This will help us see how many customers are using github actions to deploy

🎟 Issue(s)

Related #XXX

🧪 Functional Testing

List the functional testing steps to confirm this feature or fix.

📸 Screenshots

Add screenshots to illustrate the validity of these changes.

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.27%. Comparing base (cabcae3) to head (655041d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1679   +/-   ##
=======================================
  Coverage   86.27%   86.27%           
=======================================
  Files         117      117           
  Lines       17085    17085           
=======================================
  Hits        14740    14740           
  Misses       1409     1409           
  Partials      936      936           

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

@@ -58,9 +59,13 @@ func CoreRequestEditor(ctx httpContext.Context, req *http.Request) error {
}
req.URL = requestURL
req.Header.Add("authorization", currentCtx.Token)
req.Header.Add("x-astro-client-identifier", "cli")
if os.Getenv("GITHUB_ACTIONS") == "true" {
req.Header.Add("x-astro-client-identifier", "github-action")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we track github actions version also?

Copy link
Contributor

Choose a reason for hiding this comment

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

we should make the user agent also for github actions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'm not really sure how to do that

req.Header.Add("x-astro-client-version", os.Getenv("DEPLOY_ACTION_VERSION"))
case os.Getenv("GITHUB_ACTIONS") == "true":
req.Header.Add("x-astro-client-identifier", "deploy-action")
req.Header.Add("x-astro-client-version", version.CurrVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

would this be the cli or deploy actions version?

Copy link
Contributor Author

@sunkickr sunkickr Jul 22, 2024

Choose a reason for hiding this comment

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

my bad that should say github-action. github action doesn't have a version so CLI version gives us more info about what version of the CLI they are using within their github-action

@sunkickr sunkickr merged commit 3c506da into main Jul 23, 2024
2 of 3 checks passed
@sunkickr sunkickr deleted the track-github-action branch July 23, 2024 17:02
kushalmalani pushed a commit that referenced this pull request Jul 23, 2024
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.

2 participants