Skip to content

Reset quality gate, no information about who, when and why#3221

Merged
uhafner merged 11 commits intojenkinsci:mainfrom
akash-manna-sky:JENKINS-58117
Jan 6, 2026
Merged

Reset quality gate, no information about who, when and why#3221
uhafner merged 11 commits intojenkinsci:mainfrom
akash-manna-sky:JENKINS-58117

Conversation

@akash-manna-sky
Copy link
Contributor

Reset quality gate, no information about who, when and why

Fixes #2879

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@akash-manna-sky
Copy link
Contributor Author

Please review the changes. @uhafner

@uhafner uhafner added the enhancement Enhancement of existing functionality label Jan 3, 2026
Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this issue.

Do you think it is possible, to show the message immediately after the button disappears? Otherwise one needs to reload the page...

</j:if>
<j:if test="${s.qualityGateReset}">
<li style="font-style: italic; color: #666;">
Quality gate reset by ${s.resetBy} on ${s.resetTimestamp}
Copy link
Member

Choose a reason for hiding this comment

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

Can you use Luxon (<script type="text/javascript" src="${resURL}/plugin/data-tables-api/js/luxon.min.js"/>) to render the date?

Copy link
Member

Choose a reason for hiding this comment

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

Or in Jenkins core we have a Java utility that shows a timestamp in a user friendly manner: Util.getTimeSpanString.

</button>
</j:if>
<j:if test="${s.qualityGateReset}">
<li style="font-style: italic; color: #666;">
Copy link
Member

Choose a reason for hiding this comment

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

Never use style, use one of the styles in our design library (css class).

https://weekly.ci.jenkins.io/design-library/colors/

Probably the best color is secondary text.

this.id = id;
this.userId = userId;
this.timestamp = timestamp;
this.reason = reason == null ? "" : reason;
Copy link
Member

Choose a reason for hiding this comment

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

This can't be null

Suggested change
this.reason = reason == null ? "" : reason;
this.reason = reason;

private final String id;
private final String userId;
private final long timestamp;
private final String reason;
Copy link
Member

Choose a reason for hiding this comment

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

Are you planning to add support for the reason? Otherwise remove this field.

User user = User.getById(userId, false);
return user != null ? user.getFullName() : userId;
}
catch (IllegalStateException e) {
Copy link
Member

Choose a reason for hiding this comment

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

Where can this happen?

</j:if>
<j:if test="${s.qualityGateReset}">
<li style="font-style: italic; color: #666;">
Quality gate reset by ${s.resetBy} on ${s.resetTimestamp}
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a link to the user if available?

Comment on lines 111 to 128
/**
* Returns the optional reason for resetting the quality gate.
*
* @return the reason, or an empty string if no reason was provided
*/
public String getReason() {
return reason;
}

/**
* Returns whether a reason was provided for the reset.
*
* @return {@code true} if a reason was provided, {@code false} otherwise
*/
public boolean hasReason() {
return !reason.isEmpty();
}

Copy link
Member

Choose a reason for hiding this comment

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

Remove if you have no plans to support this in the UI

@uhafner uhafner marked this pull request as ready for review January 3, 2026 16:47
@github-actions github-actions bot requested a review from uhafner January 3, 2026 17:12
@akash-manna-sky
Copy link
Contributor Author

akash-manna-sky commented Jan 3, 2026

Thanks for fixing this issue.

Do you think it is possible, to show the message immediately after the button disappears? Otherwise one needs to reload the page...

I have tried to implement your this request. But can't implement properly, face many issues, so I revert the changes.

Please review the other suggested changes which I have implemented accordingly. @uhafner

Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions github-actions bot requested a review from uhafner January 6, 2026 10:50
@akash-manna-sky
Copy link
Contributor Author

I did a mistake, I force-pushed a commit without updating my branch locally, as a result your commit disappeared. I am very sorry for that. I have implemented all the requested changes. But now I’m seeing a few test failures, don't know why. I don't think these are related to my changes. What should I do now? @uhafner

@uhafner
Copy link
Member

uhafner commented Jan 6, 2026

Tipp: you should never use a force push or rebase when someone already did a code review, otherwise the annotations do not get resolved. And the reviewer needs to delete the changed branch and checkout again...

I have no idea why the artifacts are not found, I re-triggered the builds.

@uhafner uhafner merged commit 4b5dd37 into jenkinsci:main Jan 6, 2026
63 of 68 checks passed
@akash-manna-sky akash-manna-sky deleted the JENKINS-58117 branch January 7, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JENKINS-58117] Reset quality gate, no information about who, when and why

2 participants