git-plugin icon indicating copy to clipboard operation
git-plugin copied to clipboard

JENKINS-56284 Make compute changelog extensible

Open gmshake opened this issue 5 years ago • 8 comments

JENKINS-56284 - Make compute changelog extensible

Checklist

  • [x] I have read the CONTRIBUTING doc
  • [x] I have referenced the Jira issue related to my changes in one or more commit messages
  • [ ] I have added tests that verify my changes
  • [x] Unit tests pass locally with my changes
  • [ ] I have added documentation as necessary
  • [x] No Javadoc warnings were introduced with my changes
  • [x] No spotbugs warnings were introduced with my changes
  • [x] I have interactively tested my changes
  • [ ] Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply. Delete the items in the list that do not apply

  • [ ] Dependency or infrastructure update
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Further comments

If this is a relatively large or complex change, start the discussion by explaining why you chose the solution you did and what alternatives you considered.

gmshake avatar Jan 13 '20 11:01 gmshake

@MarkEWaite Previous context https://github.com/jenkinsci/git-plugin/pull/682

gmshake avatar Jan 13 '20 11:01 gmshake

Extensions are unfamiliar to me. I've requested review from @rsandell and @fcojfernandez since they likely have more experience with using the extensions API than I do.

MarkEWaite avatar Feb 02 '20 08:02 MarkEWaite

@gmshake could you elaborate a bit your proposal? You've created some classes named as "Extension" but they are not annotated. What's the expected behaviour? How is it intended that the downstream plugins work with them? because I'm getting a bit confused.

fcojfernandez avatar Feb 03 '20 07:02 fcojfernandez

@fcojfernandez For the naming, I’m not sure which one is more appropriate, extension vs strategy. The current implementation of computing changelog is somewhat rigid and this plugin provides fixed number of strategies. I intent to make it more flexible thus downstream projects can provide their own strategies.

gmshake avatar Feb 03 '20 12:02 gmshake

@gmshake it's not a matter of the name per se. What is unclear for me is how this new class will be consume? In your JIRA ticket you're mentioning github-branch-source-plugin. How this plugin would make use of GitSCMChangelogExtension? I need to understand better this before reviewing the PR

fcojfernandez avatar Feb 04 '20 08:02 fcojfernandez

@fcojfernandez Sorry for late response. I have a local fork of bitbucket-branch-source-plugin that consume this plugin. But currently I’m not able to push it to github to demonstrate the usage because of regulations caused by 2019-nCoV.

I’ll push when I’m able to do.

gmshake avatar Feb 12 '20 11:02 gmshake

@fcojfernandez Sorry for late response. I have a local fork of bitbucket-branch-source-plugin that consume this plugin. But currently I’m not able to push it to github to demonstrate the usage because of regulations caused by 2019-nCoV.

I’ll push when I’m able to do.

No worries. Just ping me again when you can do it. At a first glance I don't see anything that shocks me, but I'd like to be to test it and see how this extension is consumed by other plugins

Just a couple of things for you to address once you have availability:

  • I'm missing some tests
  • There are merge conflicts

fcojfernandez avatar Feb 17 '20 12:02 fcojfernandez

I'm back :) Rebase on latest master.

Downstream usage :

  1. bitbucket-branch-source-plugin: https://github.com/gmshake/bitbucket-branch-source-plugin/pull/1/files
  2. github-branch-source-plugin: https://github.com/gmshake/github-branch-source-plugin/pull/1/files

gmshake avatar Jun 14 '20 11:06 gmshake