jenkinsci / jenkinsci/checks-api-plugin

clarify and reject invalid columns for annotations

Open
#340 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
49
Forks
32
Avg merge
2d 5h
Merged PRs (30d)
5

Description

The values for coulmn start / end values do not state if columns are zero or 1 based.

GitHub (by far the most popular) uses 1 based indexing, as does cursor origin.

The documentation should be clear for implementators so they know what maths (if any) they need to perform on these values.

Additionally, invalid values are allowed without warning - if one based which is what [GitHub checks assumes](https://github.com/jenkinsci/github-checks-plugin/blob/68c1a6df6405d7d60fee9fcddca8a784da14e2a8/src/main/java/io/jenkins/plugins/checks/github/GitHubChecksDetails.java#L210-L211), which can cause failure to publish these checks as zero is less than 1.

The code should clarify that these are 1 based. Additionally the code should prevent invalid values from being added in the builder (like it does for `null` values).

see https://github.com/jenkinsci/warnings-ng-plugin/issues/3424 / https://github.com/jenkinsci/cursor-origin-branch-source-plugin/pull/12#issuecomment-5634061027 for an real world issue caused by this

Contributor guide

Open the contributing guide

Research direction

Start by locating the annotation builder methods that accept column start and end values, then inspect the existing null validation and related tests. Update the API documentation to state the indexing convention and ensure invalid values are rejected consistently; done means the documented behavior and validation are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.