Skip to content

Jenkins 33833: get history to work again in batch tasks#14

Open
lacostej wants to merge 8 commits intojenkinsci:masterfrom
lacostej:JENKINS-33833
Open

Jenkins 33833: get history to work again in batch tasks#14
lacostej wants to merge 8 commits intojenkinsci:masterfrom
lacostej:JENKINS-33833

Conversation

@lacostej
Copy link
Contributor

@lacostej lacostej commented Nov 2, 2023

The batch task history has been broken for a while. See https://issues.jenkins.io/browse/JENKINS-33833 for discussion and analysis.

This is a quick&dirty test to get this working again.

The PR currently sits on top of #11 which I hope to merge soon.

I would like some feedback on the approach and the direction of the feature from people with more knowledge of the internals and direction of Jenkins.

Implementation notes

Given that the HistoryPageFilter#add() logic, there were at least 3 options:

  • fix Jenkins to support the batch plugin. My guest is that this is unlikely to happen.
  • get the plugin to behave like a Job
  • get the plugin to behave like a QueueItem

I implemented a very rough "like a Job" solution and it starts giving some result, although plenty is still broken and it doesn't have any code to manage migration for now.

image

One issue that I am definitely seeing right away is that in my current implementation, the BatchRun became a Run subclass, and I am not able to serialize it nested in the build log anymore.

        <hudson.plugins.batch__task.BatchRun resolves-to="hudson.model.Run$Replacer">

I've attempted a different design (different branch), where I pass adapter classes to the build history widget, but the Run class doesn't allow to set its state at Runtime.

More info in the issue.

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 demonstrates feature works or fixes the issue

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant