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

[JENKINS-46028] Use primary job as fallback #26

Conversation

StephenKing
Copy link

@StephenKing StephenKing commented Aug 7, 2017

Currently, test results are only taken from the last builds of this job. The result is that the first build(s) of a newly created branch (when using multi-branch jobs) do not run tests in parallel, unless the build for this branch is non-FAILURE. With short-lived feature branches, this results in unsatisfying long build times.

In case of multi-branch jobs, other branches could act as a source for test records as well. The question, which branch to use as reference can be answered with the SCM's help - the PrimaryInstanceMetadataAction is assigned by several SCM plugins and denotes one/multiple branches as "primary" (in Git: the default branch when checking out).

pom.xml Outdated
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-multibranch</artifactId>
Copy link
Author

@StephenKing StephenKing Aug 7, 2017

Choose a reason for hiding this comment

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

I'm not sure if it's such good idea to pull in these additional dependencie. Any way around this? @jglick maybe? Sorry, my first Jenkins contribution.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, luckily most of them (all but branch-api) are test dependencies only.

StephenKing added a commit to emnify/jenkins-docker that referenced this pull request Aug 23, 2017
We implemented fallback to the master branch in
jenkinsci/parallel-test-executor-plugin#26

Until this is merged, we need to use our own fork.
@StephenKing
Copy link
Author

Btw. tests ran here.

Currently, test results are only taken from the last builds of this job. The
result is that the first build(s) of a newly created branch (when using multi-
branch jobs) do not run tests in parallel, unless the build for this branch is
non-FAILURE. With short-lived feature branches, this results in unsatisfying
long build times.

In case of multi-branch jobs, other branches could act as a source for test
records as well. The question, which branch to use as reference can be answered
with the SCM's help - the PrimaryInstanceMetadataAction is assigned by several
SCM plugins and denotes one/multiple branches as "primary" (in Git: the default
branch when checking out).
@StephenKing StephenKing force-pushed the JENKINS-46028-primary-job-fallback branch from e6971eb to 42d6e3b Compare August 29, 2017 08:20
@StephenKing
Copy link
Author

Hey. I've force-pushed a new version with extended tests, as we discovered a side-effect of the last change.

References: .hpi, Travis run

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Not the right place to be doing this. See JENKINS-33274.

@StephenKing
Copy link
Author

Thanks for your feedback @jglick.

I see, it would make a lot more sense to implement the API described in JENKINS-33274. But can you give me an estimation, when this API will be available in Jenkins and the Git SCM plugin? I mean, the issue is 18 months old..

It would be really nice to have a solution for the problem of non-parallel first builds (already now). That's why I went down the path to pick the most reasonable branch based on the PrimaryInstanceMetadataAction action. Or is there a better alternative available to implement this? I'd be happy to update the PR then.

Once JENKINS-33274 is merged, this plugin could still be adjusted to do it even better, right?

@jglick
Copy link
Member

jglick commented Sep 28, 2017

can you give me an estimation, when this API will be available

I do not know if it is planned for development.

Once JENKINS-33274 is merged, this plugin could still be adjusted to do it even better, right?

But then this plugin would be stuck with a stale option.

@StephenKing
Copy link
Author

Dear @jglick and @abayer,

as nothing happened on JENKINS-33274 in the meantime, I'm asking myself how to proceed with this.

I'm willing to spend some time on this PR, if you provide me some guidance how to improve the implementation -- and in general comment if you see this feature within the scope of this plugin. In case you don't think this is a worthy feature, I probably go ahead and maintain an own version.

Once JENKINS-33274 is merged, this plugin could still be adjusted to do it even better, right?
But then this plugin would be stuck with a stale option.
I'd say features can be removed with major version bumps, in case a bad implementation becomes a maintenance burden at some point.

Thanks for your feedback.

@jglick
Copy link
Member

jglick commented Jan 17, 2023

Taken over in #226.

@jglick jglick closed this Jan 17, 2023
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.

estimateTestsFrom"Branch"
2 participants