jenkinsci / jenkinsci/scm-api-plugin

[JENKINS-49610] The SCMSource.setOwner(owner) contract needs updating to include ensuring that an ID has been assigned

Open
#409 10 comments 0 reactions 0 assignees View on GitHub
component:scm-api-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
33
Forks
87
PR merge metrics
No merged PRs in 30d

Description

Discussion

We need to ensure that issues like " in logs" class="issue-link" data-issue-key="JENKINS-48571">JENKINS-48571 are more easily self-diagnosable by users.

At first glance there are two ways this could be solved:



  1. We could enforce the id assignment by throwing an IllegalStateException or similar if the id is null at the time of setOwner(non-null)

  2. We could ensure an id assignment by assigning one if the id is null at the time of setOwner(non-null) 

There may also be other potential solutions.


Acceptance Criteria



  • Assessment criteria for selection of a proposed solution have been defined and reviewed by stephenconnolly and michaelneale

  • The list candidate solutions to be assessed has been defined

  • The results of the assessment process have been reviewed with stephenconnolly and michaelneale and the winner agreed.

  • The winning solution has been implemented.

  • The documentation has been updated to include the impact.

  • Minimization of the risk of "Build storms" has been included in the assessment criteria

Critical assumpitions

(if any of these prove to be broken in the process of resolving this ticket then a replan is required)


  • There is no good reason to call setId after the owner has been assigned.

---
Originally reported by stephenconnolly, imported from: The SCMSource.setOwner(owner) contract needs updating to include ensuring that an ID has been assigned


  • status: Open
  • priority: Major
  • component(s): scm-api-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 4
  • imported: 20251223-222157

Raw content of original issue

Discussion

We need to ensure that issues like JENKINS-48571 are more easily self-diagnosable by users.

At first glance there are two ways this could be solved:



  1. We could enforce the id assignment by throwing an IllegalStateException or similar if the id is null at the time of setOwner(non-null)

  2. We could ensure an id assignment by assigning one if the id is null at the time of setOwner(non-null) 

There may also be other potential solutions.


Acceptance Criteria



  • Assessment criteria for selection of a proposed solution have been defined and reviewed by stephenconnolly and michaelneale

  • The list candidate solutions to be assessed has been defined

  • The results of the assessment process have been reviewed with stephenconnolly and michaelneale and the winner agreed.

  • The winning solution has been implemented.

  • The documentation has been updated to include the impact.

  • Minimization of the risk of "Build storms" has been included in the assessment criteria

Critical assumpitions

(if any of these prove to be broken in the process of resolving this ticket then a replan is required)


  • There is no good reason to call setId after the owner has been assigned.


Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.