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

Add includeBuildNumberInTargetPath configuration parameter #169

Merged
merged 14 commits into from Jan 29, 2023

Conversation

allancth
Copy link
Contributor

@allancth allancth commented Jan 27, 2023

Add includeBuildNumberInTargetPath configuration parameter

The new parameter includeBuildNumberInTargetPath accepts a boolean. When true, the build number of the source project will be included the target path. This is particularly useful when the selector is specific and the value is a permalink, e.g. lastSuccessfulBuild.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@allancth allancth requested a review from a team as a code owner January 27, 2023 07:43
@MarkEWaite
Copy link
Contributor

I'd much prefer that there was a test that exercises the new code and confirms it works as expected. Would you be willing to add an automated test to confirm it?

@allancth
Copy link
Contributor Author

allancth commented Jan 28, 2023 via email

@MarkEWaite
Copy link
Contributor

I can do that. Is there a test case I can refer to as reference? Regards, Allan

seems like a good match for something similar to what this new feature is doing.

@allancth
Copy link
Contributor Author

The parameter name is a bit misleading but I can't think of one better. Let me know if there are things that could improve this pull request, I'll gladly change. Thanks in advance.

@MarkEWaite
Copy link
Contributor

The parameter name is a bit misleading but I can't think of one better. Let me know if there are things that could improve this pull request, I'll gladly change. Thanks in advance.

I agree that the parameter name is a bit misleading. While I was interactively testing it, I was surprised when the build number was used as the directory name. That seemed like "prepending" rather than "appending".

Would it be clearer if it was named includeBuildNumberInTargetPath or something similar?

@MarkEWaite MarkEWaite added the enhancement New feature or improvement label Jan 28, 2023
@MarkEWaite MarkEWaite changed the title New configuration parameter appendSrcNumberToTarget New configuration parameter includeBuildNumberInTargetPath Jan 29, 2023
@allancth
Copy link
Contributor Author

Thanks Mark for the suggestion. I've updated the name of the parameter and the test case.

@MarkEWaite MarkEWaite changed the title New configuration parameter includeBuildNumberInTargetPath New configuration parameter includeBuildNumberInTargetPath Jan 29, 2023
@MarkEWaite MarkEWaite changed the title New configuration parameter includeBuildNumberInTargetPath Add includeBuildNumberInTargetPath configuration parameter Jan 29, 2023
src/main/webapp/help-flatten-optional.html Outdated Show resolved Hide resolved
@MarkEWaite
Copy link
Contributor

Thanks very much @allancth. The pull request is looking good.

In future pull requests, you can simplify things for the maintainer if you create the pull request from a feature branch rather than using the master branch. When starting development on a fresh feature, sync your repository with the upstream repository and then create a new branch with git checkout -b new-feature-name master

Also in future pull requests, you can simplify things for the maintainer if you don't remove the pull request checklist that GitHub inserts into the pull request. That checklist reminds the maintainer of things to check and can remind you of things to do as well.

@allancth
Copy link
Contributor Author

allancth commented Jan 29, 2023 via email

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Thanks again for the contribution. Ready to squash and merge. My interactive testing showed this addition was well behaved in all the cases that I tested.

@MarkEWaite MarkEWaite merged commit de867d7 into jenkinsci:master Jan 29, 2023
@MarkEWaite
Copy link
Contributor

Released as 684.vde867d759462

@MarkEWaite
Copy link
Contributor

@allancth are you interested in adopting the copyartifact plugin? The plugin has been modernized enough that the work to be a maintainer is probably no more than an hour or two a month to review pull requests for dependency updates.

@allancth
Copy link
Contributor Author

Thanks @MarkEWaite. I am interested in adopting and be happy to be a maintainer for the plugin. I have not done anything like this before hence it would be helpful if there are guides I can use.

@MarkEWaite
Copy link
Contributor

There are guides that can help. The steps are described in "Adopt a plugin" where you send email to the Jenkins developers list saying that you'd like to adopt the plugin and submit a pull request to the permissions repository that will add yourself to the list of maintainers. You need to login to https://issues.jenkins.io with your Jenkins account and you need to login to https://repo.jenkins-ci.org with your Jenkins account.

I'm happy to help with the steps if you encounter issues.

The "improve a plugin" tutorial includes videos and steps that can help (though most are already done for this plugin). If you'd like more ideas for improvements, there is the "Contributing to Open Source" document

Comment on lines +8 to +9
Include\ Build\ Number=
Copy link
Member

Choose a reason for hiding this comment

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

This will translate the strings to an empty string. Almost certainly not what you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @daniel-beck . I saw that in the code review and wondered about it. When I searched through Jenkins core and saw a number of message properties that were assigned an empty value, I thought that it must be a pattern that caused the property to be assigned the value from the default language.

An example:

https://github.com/jenkinsci/jenkins/blob/a530a99926940cb37fd2f7b66e5c2f458254a710/core/src/main/resources/hudson/logging/LogRecorder/configure_fr.properties#L24

Another example:

https://github.com/jenkinsci/jenkins/blob/a530a99926940cb37fd2f7b66e5c2f458254a710/core/src/main/resources/hudson/model/RunParameterDefinition/config_fr.properties#L24

Is the preferred pattern to leave the untranslated key out of the localized property file or is there a better way to handle it?

In this case, the best way to handle it may be to transition this plugin to use CrowdIn for its localization. That will allow translators to submit messages through the CrowdIn user interface rather than directly editing property files.

@allancth would you like to submit the pull request to remove the untranslated properties or would you prefer that I do it so that you can approve the change?

Copy link
Contributor

Choose a reason for hiding this comment

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

@allancth I submitted:

If you approve and merge, it should result in a new release with a changelog that includes the bug fix.

Comment on lines +8 to +9
Include\ Build\ Number=
Copy link
Member

Choose a reason for hiding this comment

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

As above.

MarkEWaite added a commit that referenced this pull request Jan 30, 2023
#169 added empty
translation strings.  They will cause the two items to be shown as
empty strings in the local language versions (German and Japanese).
Better to remove the empty translation properties so that the English
will be displayed.
@allancth
Copy link
Contributor Author

allancth commented Jan 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
3 participants