The Wayback Machine - http://web.archive.org/web/20210114103220/https://github.com/elastic/apm-agent-java/pull/1607
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

[CI] Run hourly to look for head changes #1607

Merged
merged 1 commit into from Jan 12, 2021

Conversation

@v1v
Copy link
Member

@v1v v1v commented Jan 8, 2021

What does this PR do?

Automatically trigger any builds for any PRs that got a change in their head target from once a week to every hour if required
This will not update the PR but the workspace where the build happens in the CI. In other words, the build merges the PR with its Target branch before running anything.

It has been configured to run hourly to avoid any issues with the GitHub API quota, we could stress a bit more to run every 30 minutes, but let's see if this approach is somehow interesting to you.

Why

This will ensure PRs are always ready to merge, even if they have not been updated with the latest changes.

@v1v v1v requested review from elastic/observablt-robots Jan 8, 2021
@v1v v1v self-assigned this Jan 8, 2021
@github-actions github-actions bot added the agent-java label Jan 8, 2021
@v1v v1v added automation ci labels Jan 8, 2021
@codecov-io
Copy link

@codecov-io codecov-io commented Jan 8, 2021

Codecov Report

Merging #1607 (32cb44f) into master (addcb42) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1607   +/-   ##
=========================================
  Coverage     58.73%   58.74%           
  Complexity       92       92           
=========================================
  Files           399      399           
  Lines         17864    17864           
  Branches       2475     2475           
=========================================
+ Hits          10493    10494    +1     
  Misses         6646     6646           
+ Partials        725      724    -1     
Impacted Files Coverage Δ Complexity Δ
...ic/apm/agent/profiler/collections/LongHashSet.java 18.25% <0.00%> (+0.39%) 0.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update addcb42...32cb44f. Read the comment docs.

@apmmachine
Copy link
Contributor

@apmmachine apmmachine commented Jan 8, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1607 opened

  • Start Time: 2021-01-08T12:05:21.820+0000

  • Duration: 44 min 0 sec

Test stats 🧪

Test Results
Failed 0
Passed 1685
Skipped 12
Total 1697

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 1685
Skipped 12
Total 1697

@cachedout
Copy link
Contributor

@cachedout cachedout commented Jan 11, 2021

I worry a bit about this behavior. Unless it's very clear what is happening, I can foresee a scenario like this:

  1. PR is submitted and tests pass.
  2. [time passes]
  3. The branch against which the PR has been submitted is updated
  4. Tests automatically (re)-run against the PR + the upstream changes.
  5. Due to a change in the upstream branch, tests fail.

At this point, if a developer goes to try to reproduce this problem, it seems natural to me that they would try to replicate it given the state of their branch when it was submitted, instead of reproducing what is actually being tests, which is their changes merged with HEAD on the branch.

If we can make it absolutely clear that the test failure happened against the changes which were merged with the head of the branch and give a clear indication to the developer against the actual test environment (their changes + HEAD), then they can replicate that state locally. Otherwise, we may be setting developers up for a very painful debugging experience. This goes doubly for OSS contributors who might get behavior they were not expecting.

Hopefully I explained this concern well, but if not I'm happy to jump on a call.

Also, if the Java devs are OK with this then it seems perfectly fine and I have no objection at all. I just wanted to specifically call out the behavior and what could happen if we aren't careful just so there aren't any misunderstandings. Thanks!

EDIT: I would almost rather see a second test (or even pipeline) that was "forward-looking" and had this aggressive merge behavior so that the developers could both see their changes tested against the branch as-submitted, and their changes tested against the head of the branch for which the PR is intended to be merged. In an ideal world, it would only run where the two differ.

@cachedout
Copy link
Contributor

@cachedout cachedout commented Jan 11, 2021

Follow-up. @v1v explained to me that this behavior is actually on by default (which I wasn't aware of) and that this change simply makes the period between checks more aggressive. That makes this change much more desirable and I think we should merge it. 👍

Copy link
Contributor

@kuisathaverat kuisathaverat left a comment

LGTM, we will consume 30-50 API calls with the scan is not too much

@v1v v1v merged commit 56bae31 into elastic:master Jan 12, 2021
11 checks passed
11 checks passed
triage triage
Details
Build Build passed
Details
CI-approved contributor
Details
CLA All commits passed the check
Details
Integration Tests Integration Tests success
Details
Javadoc Javadoc passed
Details
Smoke Tests 01 Smoke Tests 01 passed
Details
Smoke Tests 02 Smoke Tests 02 passed
Details
Unit Tests Unit Tests passed
Details
apm-ci/pr-merge This commit looks good
Details
elasticsearch-ci/docs Build finished.
Details
@v1v v1v deleted the v1v:feature/enable-auto-builds-if-head-changes branch Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.