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

feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders #4618

Merged
merged 4 commits into from Dec 22, 2023

Conversation

ciurescuraul
Copy link
Contributor

@ciurescuraul ciurescuraul commented Dec 14, 2023

Description

When defining a Jenkins job in a sub-folder, the path contains slashes. Consequently, the Spring framework is not capable of accurately matching the request.

Problem

The trigger request fails because it is attempting to initiate a job that is not found.

Solution

A feature flag has been added. This flag influences if we should call the existing endpoint (which accepts the job name as a path variable) or the new one (which accepts the job name as a query parameter).

Before

image

After

image

Related PR's

Echo: spinnaker/echo#1373
Igor: spinnaker/igor#1204

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).
Copy link
Contributor

@ovidiupopa07 ovidiupopa07 left a comment

Choose a reason for hiding this comment

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

LGTM

Map<String, Object> getBuildWithJobAsQueryParam(
@Path("buildNumber") Integer buildNumber,
@Path("master") String master,
@Query(encodeValue = false, value = "job") String job);
Copy link
Member

Choose a reason for hiding this comment

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

One concern here is on the encodeValue... if there are any kinda characters in the job name, I could see this not working UNLESS they're encoded. Wouldn't think "job" but... it's a caution flag.

@jasonmcintosh jasonmcintosh added the ready to merge Approved and ready for merge label Dec 22, 2023
@mergify mergify bot added the auto merged Merged automatically by a bot label Dec 22, 2023
@mergify mergify bot merged commit 13c6f6e into spinnaker:master Dec 22, 2023
4 checks passed
@ovidiupopa07
Copy link
Contributor

@Mergifyio backport release-1.28.x release-1.30.x release-1.31.x release-1.32.x release-1.33.x

Copy link
Contributor

mergify bot commented Jan 22, 2024

backport release-1.28.x release-1.30.x release-1.31.x release-1.32.x release-1.33.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 22, 2024
…4618)

* feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).

* feat(jenkins): initiate flag to false in tests

(cherry picked from commit 13c6f6e)

# Conflicts:
#	orca-igor/src/main/java/com/netflix/spinnaker/orca/igor/IgorFeatureFlagProperties.java
mergify bot pushed a commit that referenced this pull request Jan 22, 2024
…4618)

* feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).

* feat(jenkins): initiate flag to false in tests

(cherry picked from commit 13c6f6e)
mergify bot pushed a commit that referenced this pull request Jan 22, 2024
…4618)

* feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).

* feat(jenkins): initiate flag to false in tests

(cherry picked from commit 13c6f6e)
mergify bot pushed a commit that referenced this pull request Jan 22, 2024
…4618)

* feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).

* feat(jenkins): initiate flag to false in tests

(cherry picked from commit 13c6f6e)
mergify bot pushed a commit that referenced this pull request Jan 22, 2024
…4618)

* feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).

* feat(jenkins): initiate flag to false in tests

(cherry picked from commit 13c6f6e)
mergify bot added a commit that referenced this pull request Feb 13, 2024
…4618) (#4635)

* feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).

* feat(jenkins): initiate flag to false in tests

(cherry picked from commit 13c6f6e)

Co-authored-by: Raul Cristian <[email protected]>
mergify bot added a commit that referenced this pull request Feb 13, 2024
…4618) (#4634)

* feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).

* feat(jenkins): initiate flag to false in tests

(cherry picked from commit 13c6f6e)

Co-authored-by: Raul Cristian <[email protected]>
mergify bot added a commit that referenced this pull request Mar 14, 2024
…4618) (#4633)

* feat(jenkins): Enable Jenkins job triggers for jobs in sub-folders

- Allow triggering of Jenkins jobs that reside in sub-folders, by treating job names containing slashes as query variables.

- Prior to this feature, jobs in sub-folders were not appropriately matched by the Spring framework due to slashes in their path, causing trigger requests to fail.

- Include a new feature flag to determine the usage of the existing endpoint (which uses the job name as a path variable) or an updated endpoint (which takes the job name as a query parameter).

* feat(jenkins): initiate flag to false in tests

(cherry picked from commit 13c6f6e)

Co-authored-by: Raul Cristian <[email protected]>
Co-authored-by: Jason <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for merge target-release/1.34
Projects
None yet
4 participants