Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-66753] Ongoing build disappears from build history #5760

Merged

Conversation

janfaracik
Copy link
Contributor

@janfaracik janfaracik commented Sep 29, 2021

See JENKINS-66753

Proposed changelog entries

  • Display ongoing build in build history (regression in 2.314).

Maintainer checklist

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

  • There are at least 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 does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are correct
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (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).

@janfaracik janfaracik mentioned this pull request Sep 29, 2021
10 tasks
// The value for `page-next-build` is modified inside of `entries.jelly` on render, so set the attribute
// on element `#buildHistoryPage` after that component has been rendered to get
// the correct value to use in `filter-build-history.js`
document.getElementById("buildHistoryPage").setAttribute("page-next-build", "${it.nextBuildNumberToFetch ?: it.owner.nextBuildNumber}");
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to do this without an inline script block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not too sure sadly. Is there a way of sending the Jelly variable to filter-build-history.js without it?

Copy link
Member

Choose a reason for hiding this comment

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

Add your value to a data-whatever attribute on an element with ID and read it from there:
https://www.jenkins.io/doc/developer/security/xss-prevention/#the-good-way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could add an additional element (after <st:include page="entries.jelly" it="${page}" /> so that the value is correct) with page-next-build set instead of the inline JS -

<st:include page="entries.jelly" it="${page}" />
<div id="properties" page-next-build="${it.nextBuildNumberToFetch ?: it.owner.nextBuildNumber}"></div>

If that's what you mean?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, exactly. Thanks!

(Just to be safe, CC @Wadeck )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated it to be like that :) No more inline JS 🎉

@daniel-beck
Copy link
Member

Could you clarify whether this change addresses a recent regression or a long-standing bug? The issue description indicates it's recent, but I've had to reload the page to see new builds in the past.

@timja
Copy link
Member

timja commented Oct 5, 2021

Could you clarify whether this change addresses a recent regression or a long-standing bug? The issue description indicates it's recent, but I've had to reload the page to see new builds in the past.

it's a recent regression

@janfaracik
Copy link
Contributor Author

Could you clarify whether this change addresses a recent regression or a long-standing bug? The issue description indicates it's recent,

As Tim said above, it was a regression due to the redesign build history search bar story.

but I've had to reload the page to see new builds in the past.

I did find an issue where there is a delay in loading the history when tabbing back to the build page, I have a PR in the works though which should improve that though.

@timja timja added the bug For changelog: Minor bug. Will be listed after features label Oct 5, 2021
@timja
Copy link
Member

timja commented Oct 5, 2021

could you restore the PR template with a changelog entry?

@timja timja requested a review from a team October 5, 2021 22:05
@timja timja requested review from daniel-beck and a team and removed request for a team October 7, 2021 17:27
@timja
Copy link
Member

timja commented Oct 7, 2021

FTR this has a lot of votes on the changelog feedback https://www.jenkins.io/changelog/

@timja timja added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Oct 11, 2021
@timja
Copy link
Member

timja commented Oct 11, 2021

This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@timja timja merged commit 0991362 into jenkinsci:master Oct 12, 2021
@oleg-nenashev oleg-nenashev added the regression-fix Pull request that fixes a regression in one of the previous Jenkins releases label Oct 18, 2021
@MarkEWaite
Copy link
Contributor

@janfaracik it appears that there is still a disappearance on the very first build. See JENKINS-66969 for the report that I just verified is visible with Jenkins 2.317. Only affects the first build as far as I can tell. Builds after the first build remain visible

@janfaracik janfaracik deleted the fix-missing-build-history-in-progress-build branch January 5, 2022 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback regression-fix Pull request that fixes a regression in one of the previous Jenkins releases
Projects
None yet
6 participants