jenkinsci / nexus-platform-plugin

Nexus Platform Plugin for Jenkins
30 stars 56 forks source link

SDEV-1117: Make sure target resolution always happens from within an MasterToSlaveCallable #312

Closed langyizhao closed 4 months ago

langyizhao commented 4 months ago

https://sonatype.atlassian.net/browse/SDEV-1117

For callflow we will either reuse the scan patterns provied for the traditional scan or alternatively make use of an ovveride. In either case before hadning off to dependencies to do the actual work the patterns need to be resolved to file targets.

Because jenkins manages a cluster this needs to be done from the right context. I have refactored out the actuall file resolution logic to make it easier to re-use and created a new class that extends MasterToSlaveCallable so that we can leverage the logic from the right place.

The orginal place where this logic was used inside RemoteScanner was already within a MasterToSlaveCallable class, so nothin needed to change there, other than pointing to the logics new location.

Some tests were refactored to reflect the new location of the logic

Testing done

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

Related PR: https://github.com/jenkinsci/nexus-platform-plugin/pull/311 Which adding similar logic but closed in favor of this approach.