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

Additionally consider PR merge commits when filtering PRs #40

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Jan 23, 2023

This PR adds the ability for chronicle to consider PR merge commits relative to the release branch as a primary source of evidence for what to include or exclude from a release.

Take for example the following state:

  • PR 45 has been merged at 2023-01-17 19:27:24 UTC (relative to GitHub servers), but the tag was done locally at 2023-01-17 19:27:23 UTC. Note, they are 1 second off, implying that there is drift from the local time and GitHub's servers.
  • Result: PR 45 gets excluded from the last release (v0.2.0) and included in the next release.
  • Expected result: PR 45 should be in the v0.2.0 release and not the next release.

This PR takes PR merge commits into consideration:

[0000] DEBUG github summarizer owner=wagoodman repo=test-repo
[0000]  INFO until the current revision
[0000]  INFO since release-timestamp=2023-01-17 19:32:19 UTC tag=v0.2.0
[0000] TRACE searching commit range since=66b2b06b9a2eb9647acf55e8536c4d49e5d66066 until=1af3e39dedeb5d9c7d1a2a1a5bcc946fcb5a3fb0
[0000] DEBUG release comprised of 3 commits
[0000] TRACE   ├── 1af3e39dedeb5d9c7d1a2a1a5bcc946fcb5a3fb0
[0000] TRACE   ├── a6a00a1ab3bfa5ea3d0890d0b6782aede1064438
[0000] TRACE   └── 4a1156459c4e2c0ec2273588012f36b7bac0d6ff
[0001] DEBUG total merged PRs discovered: 36
[0001] TRACE filtering PRs by chronology
[0001] TRACE PR #1 filtered out: merged before 2023-01-17 19:27:23 UTC (merged 2022-12-09 16:31:35 UTC)
[0001] TRACE PR #2 filtered out: merged before 2023-01-17 19:27:23 UTC (merged 2022-12-06 22:18:15 UTC)
...
[0001] TRACE PR #43 filtered out: merged before 2023-01-17 19:27:23 UTC (merged 2023-01-17 18:15:15 UTC)
[0001] TRACE PR #44 filtered out: merged before 2023-01-17 19:27:23 UTC (merged 2023-01-17 16:58:30 UTC)
[0001] TRACE PR #45 filtered out: has merge commit outside of valid set 66b2b06b9a2eb9647acf55e8536c4d49e5d66066
[0001] TRACE considering re-inclusion of PRs based on merge commits
[0001] TRACE filtering remaining PRs by qualitative traits
[0001] TRACE PR #49 filtered out: missing required label
[0001] DEBUG PRs contributing to changelog: 2
[0001] TRACE   ├── #46: merged 2023-01-18 14:23:58 UTC
[0001] TRACE   └── #47: merged 2023-01-19 18:06:28 UTC
[0001] DEBUG total closed issues discovered: 5
[0001] TRACE issue #3 filtered out: closed before 2023-01-17 19:27:23 UTC (closed 2023-01-04 18:00:28 UTC)
[0001] TRACE issue #9 filtered out: closed before 2023-01-17 19:27:23 UTC (closed 2023-01-04 17:18:25 UTC)
[0001] TRACE issue #11 filtered out: closed before 2023-01-17 19:27:23 UTC (closed 2023-01-04 17:18:24 UTC)
[0001] TRACE issue #25 filtered out: closed before 2023-01-17 19:27:23 UTC (closed 2023-01-04 16:31:22 UTC)
[0001] DEBUG issues contributing to changelog: 1
[0001] TRACE   └── #48: closed 2023-01-20 14:08:14 UTC
[0001]  INFO discovered changes: 3
[0001] DEBUG   ├── added-feature (minor bump): 1
[0001] DEBUG   └── bug-fix (patch bump): 2

Note the [0001] TRACE PR #45 filtered out: has merge commit outside of valid set 66b2b06b9a2eb9647acf55e8536c4d49e5d66066, upon attempting to release v0.3.0.

This PR additionally fully implements the anchore/go-logger interface.

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman wagoodman added the bug Something isn't working label Jan 23, 2023
@wagoodman wagoodman requested a review from a team January 23, 2023 19:53
@wagoodman wagoodman enabled auto-merge (squash) January 23, 2023 19:54
@wagoodman wagoodman merged commit cc13551 into main Jan 23, 2023
@wagoodman wagoodman deleted the consider-pr-merge-commits branch January 23, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant