Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: improve transaction safety in CompleteJob function#17970

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ibetitsmike merged 1 commit intomainfrommike/claude-attempts-17694
May 21, 2025

Conversation

ibetitsmike
Copy link
Contributor

This PR refactors the CompleteJob function to use database transactions more consistently for better atomicity guarantees. The large function was broken down into three specialized handlers:

  • completeTemplateImportJob
  • completeWorkspaceBuildJob
  • completeTemplateDryRunJob

Each handler now uses the Database.InTx wrapper to ensure all database operations for a job completion are performed within a single transaction, preventing partial updates in case of failures.

Added comprehensive tests for transaction behavior for each job type.

Fixes#17694

🤖 Generated withClaude Code

This commit refactors the CompleteJob function in provisionerdserver.go touse database transactions more consistently for better atomicity guarantees.The large function was broken down into three specialized handlers:- completeTemplateImportJob- completeWorkspaceBuildJob- completeTemplateDryRunJobEach handler now uses the Database.InTx wrapper to ensure all databaseoperations for a job completion are performed within a single transaction,preventing partial updates in case of failures.Added comprehensive tests for transaction behavior for each job type.Fixes#17694🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

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

Since this is just a refactor, I found these diffs easier to grok.
The only diff is in workspace build, the insertion of timings was moved

Template import:https://www.diffchecker.com/ugtjYQgz/
Workspace build:https://www.diffchecker.com/KuvTwAPu/
DryRun:https://www.diffchecker.com/MxShZo2U/

@ibetitsmikeibetitsmike merged commitb7462fb intomainMay 21, 2025
31 checks passed
@ibetitsmikeibetitsmike deleted the mike/claude-attempts-17694 branchMay 21, 2025 14:48
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 21, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@EmyrkEmyrkEmyrk approved these changes

Assignees

@ibetitsmikeibetitsmike

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ProvisionerCompleteJob should do all db operations in a transaction

2 participants

@ibetitsmike@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp