-
Task
-
Resolution: Unresolved
-
Minor
-
None
An AbstractOrganization can have an abirtray root - organisations do not have to exist at the root of Jenkins.
However getGroup() is defined on AbstractOrganization and the API uses BlueOrganization so this leads to messy code with cast and instanceof.
The structure of the code should be re-evaluated.
[JENKINS-45604] Code has to use AbstractOrganization yet all API uses BlueOrganisation
Description |
Original:
An {{AbstractOrganization}} can have an abirtray root - organisations do not have to exist at the root of Jenkins. However {{getGroup()}} is defined on {{AbstractOrganization}} and the API uses {{BlueOrganization}} so this leads to messy code with cast and {{instanceof}}. The structure of the code should be re-evaluated. |
New:
An {{AbstractOrganization}} can have an abirtray root - organisations do not have to exist at the root of Jenkins. However {{getGroup()}} is defined on {{AbstractOrganization}} and the API uses {{BlueOrganization}} so this leads to messy code with cast and {{instanceof}}. The structure of the code should be re-evaluated. [example|https://github.com/jenkinsci/blueocean-plugin/blob/a81eaac317749a1e2aca547b99e335e3a37d3d3a/blueocean-pipeline-api-impl/src/main/java/io/jenkins/blueocean/preload/OrganizationStatePreloader.java#L29] |
Sprint | New: Blue Ocean 1.3 [ 296 ] |
Rank | New: Ranked higher |
Epic Link | New: JENKINS-35759 [ 171771 ] |
Sprint | Original: Blue Ocean 1.3-beta-2 [ 296 ] | New: Blue Ocean 1.4 [ 311 ] |
Rank | New: Ranked higher |
Seems like we are supposed to use OrganizationFactory.getItemGroup(String orgname) but we are not pointed to that in AbstractOrganization.getGroup() which should probably be protected scope to force the use of the internal API along with a javadoc comment.