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

feat: Enhance JobCreatorController to manage single job lifecycle #536

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

hollygrimm
Copy link
Contributor

Summary

This pull request makes the following changes:

  • Modify JobCreatorController to track a single job via jobID
  • Update job offer and deal event handling to filter by specific job
  • Improve result checking and processing with more robust error handling
  • Remove deprecated job offer subscription filter method
  • Simplify job tracking and event subscription logic

By isolating job output, tools like the Discord Observer can run jobs in parallel and get the appropriate job output.

Task/Issue reference

Closes: 412

Test plan

Start the stack. Run the integration tests: ./stack integration-tests

Run a job and compare the logs in the cli with the logs in this pull request.

- Modify JobCreatorController to track a single job via jobID
- Update job offer and deal event handling to filter by specific job
- Improve result checking and processing with more robust error handling
- Remove deprecated job offer subscription filter method
- Simplify job tracking and event subscription logic
@hollygrimm hollygrimm requested a review from a team as a code owner March 7, 2025 00:38
@cla-bot cla-bot bot added the cla-signed label Mar 7, 2025
@hollygrimm hollygrimm changed the title feat : Enhance JobCreatorController to manage single job lifecycle feat: Enhance JobCreatorController to manage single job lifecycle Mar 7, 2025
Copy link
Contributor

@bgins bgins left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for improving the comments and cleaning things up along the way. ❤️

return controller.SubscribeToJobOfferUpdatesWithFilter(sub, "")
// Set the controller's jobID to track this specific job
controller.jobID = container.JobOffer.ID
controller.log.Debug("Set controller jobID", map[string]interface{}{
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Have been seeing modernization suggestions in my editor recently:

modernize: interface{} can be replaced by any

Looks like go added an any to use instead of interface{}.

@hollygrimm hollygrimm merged commit cb6761a into main Mar 7, 2025
5 of 6 checks passed
@hollygrimm hollygrimm deleted the hollygrimm/feat-isolate-job-results-in-cli branch March 7, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants