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

Simplify code #118

Merged
merged 3 commits into from
Apr 26, 2020
Merged

Conversation

darxriggs
Copy link
Contributor

This is all about simplifying code around getting an instance of Jenkins.

More details can be found in the commit comments.

`JobConfigHistoryBaseAction` already contains a `Jenkins` instance.
If `nodes` is anyway set on first call of `onConfigurationChange` it is
not required to set it in the constructor. This simplifies the code.
Beeing able to overwrite this was used for testing purposes only.
This complicated code a bit and was not used very often.

The only use case at the moment is to test authorization for some methods.
This can also be achieved by overwriting `getAccessControlledObject()`
which was already done in other tests.
@Jochen-A-Fuerbacher
Copy link
Member

We're planning to do a release of JobConfigHistory soon. I prefer to merge this PR after the next release.

@darxriggs
Copy link
Contributor Author

That's ok for me. I am already working on another pull request.

@mfriedenhagen
Copy link
Member

Hello, I think I introduced the indirection because testing gets easier with this

@darxriggs
Copy link
Contributor Author

@mfriedenhagen Have you seen my commit message on b3e06d2 regarding the removal of the Jenkins instance? What's your opinion on it?

How do we go on with this pull request? Are there objections to not merge it as is?

@mfriedenhagen
Copy link
Member

@darxriggs, I would always prefer to inject such a dependency but as I am not actively involved in the development anymore, I think @Jochen-A-Fuerbacher should decide.

@Jochen-A-Fuerbacher Jochen-A-Fuerbacher merged commit 1ae2784 into jenkinsci:master Apr 26, 2020
@darxriggs darxriggs deleted the simplify-code branch April 26, 2020 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants