Skip to content

Added some jelly documentation for step for numbers#10983

Open
StefanSpieker wants to merge 5 commits intojenkinsci:masterfrom
StefanSpieker:step_docu
Open

Added some jelly documentation for step for numbers#10983
StefanSpieker wants to merge 5 commits intojenkinsci:masterfrom
StefanSpieker:step_docu

Conversation

@StefanSpieker
Copy link
Contributor

@StefanSpieker StefanSpieker commented Aug 17, 2025

When I was working with jelly files I saw that step is not recognized in IntelliJ:
grafik

After this change, the documentation is shown:
grafik

Testing done

Only testing in IntelliJ

Proposed changelog entries

  • added documentation for step to jelly documentation

Proposed changelog category

/label developer

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@comment-ops-bot comment-ops-bot bot added the developer Changes which impact plugin developers label Aug 17, 2025
Copy link
Member

@krisstern krisstern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Aug 17, 2025
Copy link

@A1exKH A1exKH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@daniel-beck daniel-beck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added documentation seems to be an incorrect copy & paste.

Comment on lines +69 to +70
This will work only if @clazz is 'number', 'number-required', 'non-negative-number-required',
'positive-number', 'positive-number-required'.
Copy link
Member

@daniel-beck daniel-beck Aug 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would that be the case? min and max are specifically supported by registerMinMaxValidator. step is only used by the browser's basic number spinner control. Nothing in Jenkins that I could find cares about this parameter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As step is passed to the input (as are min and max due to the morphtag) it would also be possible to use 0.1 for step (might not make sense to use non integer step values it in most places). But with a 0.1 step setting the validator would not work anymore as it expect integers.
But the step can definitely be used without any of the classes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would also be possible to use 0.1 for step (might not make sense to use non integer step values it in most places).

This would contradict the below line, stating

If this value contains non-digit characters, it will not work.

Although it's unclear what would "not work", as there's nothing in Jenkins supporting this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using any of the number classes then the step should be an integer. Otherwise the spinner of the input would change the field to non integer values.
But without the number classes a step of 0.1 works fine

@daniel-beck daniel-beck removed the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Aug 17, 2025
@NotMyFault NotMyFault self-requested a review August 18, 2025 12:52
StefanSpieker and others added 2 commits October 4, 2025 11:20
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
@StefanSpieker
Copy link
Contributor Author

Thanks a lot for the suggestions and explanations!

@mawinter69
Copy link
Contributor

Ideally we document that values for step other than integers only work when none of the validating classes like number or positive-number are used.

@StefanSpieker
Copy link
Contributor Author

Can you suggest a text? I do not really understand what I should change. We are in a number.jelly file and I thought it is obvious that we are dealing with some kind of numbers.

@mawinter69
Copy link
Contributor

clazz="number" checks that you enter only integer values. But technically a number input works well with floats. So the combination clazz="number" step="0.1" will lead to validation failure when clicking the spinner. But just having step="0.1" is totally fine when the intention is to allow floating numbers.

The step size of the @value. The default is 1. This becomes the @step of the <input> tag.
The step should be an integer when using any of the validating @clazz values.
Otherwise the spinner of the input will change the field to non integer values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

developer Changes which impact plugin developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants