Coder Social home page Coder Social logo

Comments (5)

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on July 19, 2024 2

Can we guarantee the order of the factories to make sure ours will be executed first ?

You could specify a high ordinal, e.g. @Extension(ordinal = 100000). I think that would let your factory be called first, especially if other implementations don't specify ordinals at all.

from checks-api-plugin.

XiongKezhi avatar XiongKezhi commented on July 19, 2024

yes, that's a problem since we didn't expect there will be such a use case; we thought users will always use our implementation for GitSCM or GitHub Branch Source SCM (they are exclusive so the order is fine).

Now maybe making the ChecksPublisher comparable so that we can sort the stream before findFirst will solve the problem. We can make our implementation the lowest priority and the users' will be used first.

from checks-api-plugin.

timja avatar timja commented on July 19, 2024

or making it user selectable and hiding the choice if only one extension is available?
it's a reasonably common pattern,

Used in at least github api endpoints, fingerprinting, junit pluggable storage

from checks-api-plugin.

uhafner avatar uhafner commented on July 19, 2024

I think I have the same problem in my git-forensics plugin that tries to select reference builds (and mines repositories). It would make sense if we could use the same approach. The same happens if someone checks out from several repositories: I think we should make it possible to configure the repository (and use the first one if nothing has been configured). See jenkinsci/git-forensics-plugin#213

from checks-api-plugin.

agaudreault avatar agaudreault commented on July 19, 2024

Thanks @KalleOlaviNiemitalo, I looked at the doc too quickly and never saw ordinal there! It seems like it will solve my usecase.

https://github.com/jenkinsci/jenkins/blob/d014a3159f2f4d5f7bfb6a1cb8867ed9b1fa5273/test/src/test/java/hudson/ExtensionListTest.java#L199-L208

from checks-api-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.