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

[SDTEST-528] Add pull_request extra tags for GitHub Actions #238

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

anmarchenko
Copy link
Member

What does this PR do?
Adds extra tags with Git metadata for Github Actions workflows that are triggered with pull_request event.

Motivation
In GHA pull_request workflows HEAD does not point to the last commit in the PR, but to a commit that is the result of merging PR branch with the target branch.

Datadog backend needs additional information in this case to correctly determine the latest commit in the PR branch.

How to test the change?
Unit tests are provided

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.95%. Comparing base (f3d84e6) to head (960d008).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #238   +/-   ##
=======================================
  Coverage   98.95%   98.95%           
=======================================
  Files         273      273           
  Lines       13381    13402   +21     
  Branches      601      604    +3     
=======================================
+ Hits        13241    13262   +21     
  Misses        140      140           
Flag Coverage Δ
98.95% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@@ -967,7 +967,7 @@ def rspec_skipped_session_run
let(:integration_options) { {service_name: "lspec"} }
end

it "retries test until it passes" do
it "does not report the test that failed when RSpec was quitting" do
Copy link
Member Author

Choose a reason for hiding this comment

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

This change is not relevant to this PR's topic, I just noticed that one of the specs was copy-pasted without changing description

@@ -710,5 +710,70 @@
"git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123",
"git.repository_url": "https://1.1.1.1:1234/ghactions-repo.git"
}
],
[
Copy link
Member Author

Choose a reason for hiding this comment

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

here are the actual test cases:

  1. happy path
  2. case where events file is not found

@anmarchenko anmarchenko merged commit 4871058 into main Sep 23, 2024
30 checks passed
@anmarchenko anmarchenko deleted the anmarchenko/gha_pull_request_tags branch September 23, 2024 14:58
@github-actions github-actions bot added this to the 1.7.0 milestone Sep 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.

3 participants