-
Notifications
You must be signed in to change notification settings - Fork 537
JENKINS-44208 Web url builder extension #1063
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
Conversation
This is to provide fine grained control for other plugins to generate url for given model object.
Nice 👍 |
@alvarolobato PTAL. I think I have everything you need.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vivek . Looks good, just some minor comments.
public String getUrl(@Nonnull ModelObject modelObject) { | ||
BlueOrganization organization = getOrganization(modelObject); | ||
if(organization == null){ //no organization, best we can do is to land user on landing page | ||
return getLandingPagePath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better just return null and let the default behaviour return the landing page or another mapper handle it?
In any case this is ordinal -9999 so it would always be the last one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alvarolobato getLandingPagePath()
is computed using BlueOceanUIProvider
, so should be fine, anyways ordinal value is going to let other plugins override it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I miss read the method.
* @author Vivek Pandey | ||
*/ | ||
@Extension(ordinal = -9999) | ||
public class BlueOceanUrlActionImpl implements BlueOceanUrlAction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
* @author Vivek Pandey | ||
*/ | ||
@Extension(ordinal = -9999) | ||
public class BlueOceanUrlActionFactoryImpl extends BlueOceanUrlActionFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be moved outside blueocean-pipeline-api-impl
there's nothing specific to pipeline here anymore, and should be possible to use it without pipeline plugins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, it used to depend on this plugin but with this PR, we can pretty much move it inside blueocean-rest-impl.
|
||
import javax.annotation.Nonnull; | ||
|
||
import static io.jenkins.blueocean.BlueOceanUrlMapperImpl.getLandingPagePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably should need to be moved here, as we may not have the dependency with pipeline plugins
🐝 |
- Removed try.js as it's not more needed
@alvarolobato PTAL. I think I have answered your concerns. There are ATH tests failing as |
@imeredith PTAL at ATH changes. |
@imeredith tests are failing with same error:
Perhaps these changes expose this timing bug? @imeredith It will be great if you could try out this branch. |
@vivek .useXpath() sets all selectors in the future to be xpath. A css one is failing so im guessing your use of xpath caused this (noticed in changes). You can do .useCss() to fix that |
Also the stuff in addOpenBlueOceanLinkToFooter is just flaky in general. If you cant get a test to pass it, try restarting the ATH server. its a real PITA. |
@imeredith Ah, right. I reset selector to css. Lets see how this run goes. |
Provides methods to open and check visibility of 'open blue ocean' link
@imeredith I changed openBlueOcean.js from command to page object. This way there is one place to open blueocean page and check it's visibility. All looks good now. PTAL before I merge:) |
http://127.0.0.1:50313 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably should be ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is in my latest stuff
🐝 from me but need @imeredith to give this the nod - as it is a bit of a cross cutting change, but looks great! |
Why a pageobject and not a command? For a start its not a page, but it exists on most of classic pages. |
@imeredith nightwatch page objects can be anything that appears on a page and tests want access to it, so it's fine for it to be page object without any side effect. Other reasons listed below:
|
🐝 |
Description
See JENKINS-44208.
ModelObject
url mapping implement BlueOceanUrlMapperBasically, idea is for plugins interested in customizing blueocean url mapping for given ModelObject, they can implement
BlueOceanUrlMapper
. If there is need to customizeOpen Blue Ocean
menu item/action, then implementBlueOceanUrlAction
andBlueOceanUrlActionFactory
.Submitter checklist
Reviewer checklist