jenkins-infra / kubernetes-management

Jenkins Infrastructure Kubernetes Management
MIT License
53 stars 45 forks source link

Run only `Jenkinsfile_updatecli` if `updatecli` is the only folder updated #4891

Open lemeurherve opened 6 months ago

lemeurherve commented 6 months ago

What feature do you want to see added?

Similar to https://github.com/jenkins-infra/docker-jenkins-weekly and using a script like https://github.com/jenkins-infra/docker-jenkins-weekly/blob/main/bin/select-target-from-modified-files.sh, I propose to run only updatecli and not Jenkinsfile_k8s if only the updatecli folder is updated.

Super low priority, but could be a nice little QoL improvement.

Upstream changes

No response

dduportal commented 6 months ago

At first sight, -1 from me.

If we change the content of the repository, updatecli must always be run even if the manifest is not updated to ensure its target has not been changed and are still valid.

As such, there is no reason to "optimize" in this case (which is different than the build itself)

lemeurherve commented 6 months ago

If we change the content of the repository, updatecli must always be run even if the manifest is not updated to ensure its target has not been changed and are still valid.

I agree, that's the contrary I'm proposing here 🙂

If only the updatecli folder has been changed, there is (IMO) no need to run the complete kubernetes-management pipeline, just the updatecli one.

dduportal commented 6 months ago

If we change the content of the repository, updatecli must always be run even if the manifest is not updated to ensure its target has not been changed and are still valid.

I agree, that's the contrary I'm proposing here 🙂

If only the updatecli folder has been changed, there is (IMO) no need to run the complete kubernetes-management pipeline, just the updatecli one.

my bad, it makes sense then.

I'm not sure about the branch protection though: I'm not aware of branch protection rules which should be conditional though

lemeurherve commented 6 months ago

The main pipeline could just return a success with a message like "INFO: the only folder modified is updatecli, skiping." in that case, WDYT?