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

Change get_commits_since so that it won't take commits from other branches #12376

Merged
merged 1 commit into from
Jun 16, 2022

Conversation

alopezz
Copy link
Contributor

@alopezz alopezz commented Jun 16, 2022

What does this PR do?

Changes the behaviour of get_commits_since so that it uses git's .. operator instead of ... to define the commit range.

Motivation

AI-2131. This is trying to avoid incorporating commits from non-master branches into releases.

Additional Notes

I'm not sure what the original expected behaviour for this function was, so the reason why ... was being used originally is unknown to me. I'm also not very confident about my understanding of ... and why it does what it does in this case.

To test this manually, based on reproducing the case reported in AI-2131, what I did was:

  • Clone integrations-core separately.
  • git checkout 7.34.0-rc.2
  • ddev -x release make http_check

I also tried the git commands that this function runs to check that .. gives us what we want for this case:

git log --pretty=%s http_check-6.1.2... http_check

Release integrations for 7.34 (#11076)
Release changed integrations for 7.33.0-rc.14 (#11072)
Add urllib3 as dependency (#11069) (#11071)
Add urllib3 as dependency (#11069)
Fix urllib3 import statement (#11065)
add comment to autogenerated model files (#10945)
Generate example usage of custom config model validators (#10927)
DOCS-2530 Lint Integrations section (part 5) (#10805)
Update `test_instance_auth_token` to run check twice and add more header tests (#10653)

(note the duplicate #11069)

git log --pretty=%s http_check-6.1.2.. http_check
Release integrations for 7.34 (#11076)
Add urllib3 as dependency (#11069)
Fix urllib3 import statement (#11065)
add comment to autogenerated model files (#10945)
Generate example usage of custom config model validators (#10927)
DOCS-2530 Lint Integrations section (part 5) (#10805)
Update `test_instance_auth_token` to run check twice and add more header tests (#10653)

After the change, if I run ddev -x release make http_check, I get a changelog that looks right:

+## 6.1.3 / 2022-06-16
+
+* [Fixed] Add urllib3 as dependency. See [#11069](https://github.com/DataDog/integrations-core/pull/11069).
+* [Fixed] Fix urllib3 import statement. See [#11065](https://github.com/DataDog/integrations-core/pull/11065).
+* [Fixed] Add comment to autogenerated model files. See [#10945](https://github.com/DataDog/integrations-core/pull/10945).
+

Also, these are the places where this is used:

./datadog_checks_dev/datadog_checks/dev/tooling/commands/release/changelog.py
79:    diff_lines = get_commits_since(check, None if initial else target_tag, end=end, exclude_branch=exclude_branch)

./datadog_checks_dev/datadog_checks/dev/tooling/commands/release/show/changes.py
55:    diff_lines = get_commits_since(check, target_tag, end=end, exclude_branch=exclude_branch)

./datadog_checks_dev/datadog_checks/dev/tooling/commands/release/show/ready.py
28:        diff_lines = get_commits_since(target, target_tag)

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #12376 (4b1844a) into master (f245e7c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Flag Coverage Δ
arangodb 98.21% <ø> (ø)
btrfs 82.91% <ø> (ø)
calico 83.33% <ø> (ø)
cloud_foundry_api 95.98% <ø> (+0.12%) ⬆️
disk 89.42% <ø> (ø)
dns_check 93.84% <ø> (ø)
external_dns 89.09% <ø> (ø)
go_expvar 92.73% <ø> (ø)
ibm_i 81.58% <ø> (ø)

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

@alopezz alopezz changed the title Change get_commits_since so that it won't take commits from other branches Change get_commits_since so that it won't take commits from other branches Jun 16, 2022
Copy link
Contributor

@fanny-jiang fanny-jiang left a comment

Choose a reason for hiding this comment

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

🔥

@alopezz alopezz merged commit cfd1625 into master Jun 16, 2022
@alopezz alopezz deleted the alopez/dev/release-make-all-exclude-branches branch June 16, 2022 15:45
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.

2 participants