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

Support PullRequest builds from other repos #1354

Merged
merged 2 commits into from
Mar 21, 2018

Conversation

AdamBrousseau
Copy link
Contributor

@AdamBrousseau AdamBrousseau commented Mar 6, 2018

  • Determine if build is a PR
  • Automatically checkout PR and any dependent PRs
  • Support dependent changes from other repos

[ci skip]

Issue #660

Signed-off-by: Adam Brousseau adam.brousseau88@gmail.com

TODO

  • Update README
  • Open Eclipse Bugzilla to request Jenkins Webhook be added to openj9-omr repo
    • Resolved

@AdamBrousseau AdamBrousseau force-pushed the support_extensions_prs branch 3 times, most recently from 931ea0a to dc882da Compare March 6, 2018 15:29
openjdk_bool = true
break
default:
error "Unable to determine sourece repo for PullRequest"
Copy link
Member

Choose a reason for hiding this comment

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

sourece -> source

@AdamBrousseau AdamBrousseau force-pushed the support_extensions_prs branch 6 times, most recently from 4bcf1c2 to 788216a Compare March 6, 2018 20:15
@AdamBrousseau
Copy link
Contributor Author

adam test sanity plinux jdk9

@AdamBrousseau
Copy link
Contributor Author

adam test sanity plinux jdk9 depends eclipse/omr#2357 ibmruntimes/openj9-openjdk-jdk8#58

@AdamBrousseau
Copy link
Contributor Author

Regular OpenJ9 PR
OpenJ9 PR with 2 dependent changes
OpenJDK8 PR with dependent 2 changes

Do we want to protect against people specifying dependent changes from the incorrect version of an openjdk-extensions repo?
eg. jenkins test sanity all jdk9 depends ibmruntimes/openj9-openjdk-jdk8#123

@pshipton
Copy link
Member

pshipton commented Mar 6, 2018

Do we want to protect against people specifying dependent changes from the incorrect version of an openjdk-extensions repo?

I think so. Better than ignoring the dependent change and running the build anyway. How would it work? Perhaps running a job that immediately fails with an explanation of the problem.

@AdamBrousseau
Copy link
Contributor Author

adam test sanity plinux jdk9 depends eclipse/omr#2357 ibmruntimes/openj9-openjdk-jdk8#58

@AdamBrousseau
Copy link
Contributor Author

adam test sanity plinux jdk9 depends eclipse/omr#2357 ibmruntimes/openj9-openjdk-jdk9#108

@AdamBrousseau
Copy link
Contributor Author

@AdamBrousseau AdamBrousseau force-pushed the support_extensions_prs branch 8 times, most recently from 0c55da9 to e86edc8 Compare March 8, 2018 17:08
@AdamBrousseau AdamBrousseau changed the title WIP: Support PullRequest builds from other repos Support PullRequest builds from other repos Mar 8, 2018
@AdamBrousseau
Copy link
Contributor Author

@vsebe for review

@vsebe
Copy link
Contributor

vsebe commented Mar 8, 2018

desk review

@AdamBrousseau
Copy link
Contributor Author

updated

@AdamBrousseau
Copy link
Contributor Author

adam test sanity plinux jdk9 depends eclipse/omr#2357

@AdamBrousseau
Copy link
Contributor Author


// Setup PR_IDs for dependent changes
for (DEPEND in DEPENDS_ARRAY) {
String REPO = DEPEND.substring(DEPEND.indexOf("/") + 1, DEPEND.indexOf("#"));
Copy link
Contributor

Choose a reason for hiding this comment

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

extra space before "="

echo "No dependent changes found"
} else {
// Gather everything after KEYWORD. Assumes a whitespace after KEYWORD, hence +1
def DEPENDS_BLOB = COMMENT.substring(COMMENT.indexOf(KEYWORD) + KEYWORD.length() + 1 , COMMENT.length())
Copy link
Contributor

Choose a reason for hiding this comment

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

extra space before "="

checkout_pullrequest(OPENJDK_PR)
}

sh 'bash ./get_source.sh'
Copy link
Contributor

Choose a reason for hiding this comment

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

Inconsistency: use of single quotes instead of double quotes.

- Determine if build is a PR
- Automatically checkout PR and any dependent PRs
- Simplify compile_only PRs to be the same process as Build jobs
- Support dependent changes from other repos
- Verify OpenJDK dependent changes are the correct repo version

[ci skip]

Issue eclipse-openj9#660

Signed-off-by: Adam Brousseau <adam.brousseau88@gmail.com>
- Remove build badges for PR builds
- Simplify PR build section
- Indicate PR builds are replicated per REPO, per SPEC and per sdk VERISON

[ci skip]

Issue eclipse-openj9#660

Signed-off-by: Adam Brousseau <adam.brousseau88@gmail.com>
@AdamBrousseau
Copy link
Contributor Author

updated

@vsebe
Copy link
Contributor

vsebe commented Mar 8, 2018

LGTM

@AdamBrousseau
Copy link
Contributor Author

Ready for committer review @pshipton or @DanHeidinga

@keithc-ca
Copy link
Contributor

I'm not convinced this is a good direction to go. Rather than adjust the infrastructure to manage pull requests that must be coordinated across multiple repositories, I think we should aim to have pull requests that can be merged sequentially (first omr then openj9, or vice-versa). It may require a little more thought and work on the part of the author of the PRs, but I am confident that those PRs can always be constructed so there is an order they can be merged without build breakage at any intermediate state.

It can also get very complicated: consider a PR that is connected to openj9-openjdk changes. Currently this PR will only let one specify dependencies on one extension repo. If changes are required for jdk8, it's likely it also affects jdk9 (and jdk10, etc. - something not supported by the current proposal): where do we draw the line? I say that line should be at zero dependencies.

@AdamBrousseau
Copy link
Contributor Author

@keithc-ca I agree that not having/needing dependent changes is a good idea. However, this PR is not about adding support for dependent changes, it is simply extending PR builds to other repos, which in turn extends the dependent change support. Also, there is an open issue (#827) to extend the "depends" support to also work with branches rather than just open PRs.

@AdamBrousseau
Copy link
Contributor Author

If we want to discuss the validity of having dependent changes can we open a separate issue where the team leads can discuss? I don't think that conversation should be a blocker to this PR.
@keithc-ca @DanHeidinga

@keithc-ca
Copy link
Contributor

On the contrary, I don't think we should be complicating things (like merging this PR would) until we have agreed that we want to consider PRs that come with dependencies.

@AdamBrousseau
Copy link
Contributor Author

Keep in mind, we already support having pull requests with dependent changes. The purpose of this PR is extending PR Build functionality to the extensions repos. The only added functionality is the protection against cross-version dependent changes, which you could argue should be in a different PR as we actually have this vulnerability today, without these changes.

@keithc-ca
Copy link
Contributor

I still don't think we should be doing this. If (and that a big if) we want to consider dependent PRs involving the extension repos, then it needs to allow specification of all the extension repos, not at most one.

@AdamBrousseau
Copy link
Contributor Author

@pshipton
Copy link
Member

There are times when having dependent changes is just easier. Perhaps they could be committed in multiple steps to avoid the dependencies, but why would we want to do that dance when the changes can be committed (very closely) together. Seems like a waste of developer, committer, and machine time to avoid a very small timing hole. Dependent omr changes can be problematic because of the omr acceptance build, but there is no such issue for committing dependencies between openj9 and the extensions repos.

With this PR, builds for all the extensions repos can be done, it just requires multiple commands. This could be improved in the future, if there is nothing better to do, but its not a requirement that needs to block merging this.

@DanHeidinga
Copy link
Member

@pshipton I agree with you this is the right approach for now but have to take issue with:

but why would we want to do that dance when the changes can be committed (very closely) together. Seems like a waste of developer, committer, and machine time to avoid a very small timing hole.

That small timing hole leaves the repos in a broken state. It stops tools like git bisect from running. It leaves other developers with potentially broken repos.

Dependent changes externalize the cost of delivering a change from the dev making the change to everyone consuming the project. It's not a great trade off.

Unfortunately, there are some dependent changes that we can't avoid. We need this as a tool for those (rare) cases.

Committers should continue to encourage all developers to stage their changes so we don't need this kind of tool.

@pshipton
Copy link
Member

@DanHeidinga agreed. Good point, the timing hole I mentioned can sometimes be avoided by committing the changes in the correct order, even if they are within a few seconds of each other.

Copy link
Member

@DanHeidinga DanHeidinga left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me. The doc issues can be addressed in a separate PR.

@@ -72,11 +74,9 @@ You can also request a "Compile & Sanity" build from the extensions repos or ope
- Ex. Dependent change in OpenJDK Pull Request `#789`
- `Jenkins test sanity depends ibmruntimes/openj9-openjdk-jdk9#789`
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this line missing all jdk9 as well?

@@ -72,11 +74,9 @@ You can also request a "Compile & Sanity" build from the extensions repos or ope
- Ex. Dependent change in OpenJDK Pull Request `#789`
- `Jenkins test sanity depends ibmruntimes/openj9-openjdk-jdk9#789`
- Ex. Dependent changes in OMR and OpenJDK
- `Jenkins test sanity depends eclipse/omr#123 ibmruntimes/openj9-openjdk-jdk9#789`
- `Jenkins test sanity all jdk9 depends eclipse/omr#123 ibmruntimes/openj9-openjdk-jdk9#789`
Copy link
Member

Choose a reason for hiding this comment

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

This fixes one of these - aren't other commands incorrect as well?

@keithc-ca
Copy link
Contributor

I hadn't thought of the use cases where it simply makes life easier for a committer - those make sense. Ultimately, a committer has the responsibility to ensure that merges go smoothly and if this helps, I'm fine with it.

@pshipton pshipton merged commit 81b5342 into eclipse-openj9:master Mar 21, 2018
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.

5 participants