Skip to content

Conversation

FahadBSyed
Copy link
Contributor

@FahadBSyed FahadBSyed commented Aug 5, 2024

  1. onUpsert now passes through the pfsdb.Commit
  2. There's some weird branch and commit logic that we have to do as a result of our data model that I figured I'd extract into a single function to make deprecation later easier to do.

The next PR will be an update that actually creates an internal commit model that we can use. This will be handiest in functions like inspect commit which have to re-resolve the commit handles for provenance and such.

@FahadBSyed FahadBSyed requested a review from a team as a code owner August 5, 2024 17:07
Copy link

github-actions bot commented Aug 5, 2024

size-limit report 📦

Path Size
Entry 92.96 KB (0%)
Vendor XL 801.19 KB (0%)
Chunks 292.45 KB (0%)
Everything 1.16 MB (0%)

@FahadBSyed FahadBSyed changed the title [PFS-171] Extract the Atomic Branch and Commit Updates into a Single Function [PFS-171] Update onUpsert Interface, Refactor StartCommit Aug 5, 2024
@FahadBSyed FahadBSyed requested review from Zhang-Muyang and removed request for brycemcanally August 5, 2024 19:05
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 94.59459% with 4 lines in your changes missing coverage. Please review.

Project coverage is 58.70%. Comparing base (61ec51b) to head (fd86c75).

Files Patch % Lines
src/server/pfs/server/server_commit.go 94.44% 3 Missing ⚠️
src/server/pfs/server/server_branch.go 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10253      +/-   ##
==========================================
- Coverage   58.77%   58.70%   -0.07%     
==========================================
  Files         637      637              
  Lines       77027    77033       +6     
==========================================
- Hits        45271    45223      -48     
- Misses      31198    31251      +53     
- Partials      558      559       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

return errors.Wrap(err, "update commit")
}
if err := atomicUpsertBranchAndCommitBranch(ctx, txnCtx.SqlTx, branchInfo, newHead.ID); err != nil {
return errors.Wrap(err, "fill new branches")
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel callers of fillNewBranches may wrap the error around "fill new branches". So it might better if it can indicate upsert branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

something like "fill new branches: upsert branch"?

}

func (a *apiServer) validateStartCommitArgs(ctx context.Context, txnCtx *txncontext.TransactionContext, branchHandle *pfs.Branch) error {
// Validate arguments:
Copy link
Contributor

Choose a reason for hiding this comment

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

this comment might be unnecessary now. The err msg and function name indicate the purpose

@FahadBSyed FahadBSyed merged commit 5594781 into master Aug 7, 2024
17 of 25 checks passed
@FahadBSyed FahadBSyed deleted the PFS-171-commit branch August 7, 2024 13:49
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.

2 participants