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

fix: Cannot setup a pipeline #461

Merged
merged 1 commit into from
Aug 7, 2023
Merged

fix: Cannot setup a pipeline #461

merged 1 commit into from
Aug 7, 2023

Conversation

robinsoc
Copy link
Contributor

Fixes request #33320 Cannot setup a pipeline using a Tuleap Branch Source

Users should now be able to create a new Tuleap multibranch project.
No functional changes expected for Tuleap Organization project type

@robinsoc robinsoc requested a review from Erwyn August 1, 2023 07:10
@Erwyn Erwyn self-assigned this Aug 1, 2023
Copy link
Member

@LeSuisse LeSuisse left a comment

Choose a reason for hiding this comment

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

Could you please summarize in the commit message why it broke?
Should we raise the minimal supported version of Jenkins to avoid having a too large range?

…group_id=101) Cannot setup a pipeline using a Tuleap Branch Source

Even if the `Tuleap` type can be selected in `Multibranch Pipeline` project type,
it never properly worked whatever the Jenkins version.
The implemented code did not take in account the fact that user can configure a `Tuleap` project in a `Multibranch Pipeline` project.
During the first implementation of the plugin, the creation of
`Mulitbranch Pipeline` projects was directly made by the "navigator" of
`Tuleap Organization Folder` project and other cases was not taken in
account.

Now, users should now be able to create a new Tuleap multibranch project.
No functional changes expected for Tuleap Organization project type

It should works fine with the Jenkins version 2.361.4 and later
@robinsoc robinsoc force-pushed the fix/multibranch-project branch from 5647a2f to 4ae353b Compare August 2, 2023 09:57
@robinsoc
Copy link
Contributor Author

robinsoc commented Aug 2, 2023

Could you please summarize in the commit message why it broke?

Done

Should we raise the minimal supported version of Jenkins to avoid having a too large range?

No, it should be fine, finally the bug was not dependent of the Jenkins version

public TuleapSCMSource(TuleapProject project, TuleapGitRepository repository) {
this.repository = repository;
this.project = project;
this.projectId = String.valueOf(project.getId());
this.repositoryPath = repository.getPath();
}

@DataBoundConstructor
public TuleapSCMSource(String projectId, String repositoryPath) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If it is possible, I think it would be better if this constructor also populated this.project and this.projectId itself so that we are always sure of what we have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already thought to do that, but I think this is not a good idea because of the DataBoundConstructor, it does some automagic binding, and it may introduce some unwanted side effect which can be hard to debug

Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't the @DataBounConstructor only taking into account the arguments of the constructior ie projectId and repositoryPath ?

https://javadoc.jenkins.io/component/stapler/org/kohsuke/stapler/DataBoundConstructor.html

The matching is done by using the constructor parameter name

Or are your worried about something else that I don't see ? I haven't looked into this in quite a while...

@Erwyn Erwyn merged commit c361726 into master Aug 7, 2023
@Erwyn Erwyn deleted the fix/multibranch-project branch August 7, 2023 15:27
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.

3 participants