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

fixed sql-error-441 #806

Merged
merged 3 commits into from
Oct 25, 2020
Merged

Conversation

ari-hacks
Copy link
Contributor

@ari-hacks ari-hacks commented Oct 12, 2020

#441

New Output:
Screen Shot 2020-10-22 at 7 38 59 PM

@codecov-io
Copy link

codecov-io commented Oct 12, 2020

Codecov Report

Merging #806 into master will increase coverage by 4.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #806      +/-   ##
==========================================
+ Coverage   41.07%   45.10%   +4.02%     
==========================================
  Files         129      140      +11     
  Lines       10044    10855     +811     
==========================================
+ Hits         4126     4896     +770     
+ Misses       5380     5326      -54     
- Partials      538      633      +95     
Impacted Files Coverage Δ
catalog/cataloger_create_repository.go 59.25% <0.00%> (+2.11%) ⬆️
catalog/cataloger_delete_branch.go 60.00% <0.00%> (-5.72%) ⬇️
catalog/views.go 97.01% <0.00%> (-2.99%) ⬇️
onboard/import.go 62.74% <0.00%> (-2.57%) ⬇️
onboard/catalog_actions.go 67.85% <0.00%> (-2.28%) ⬇️
catalog/cataloger_list_entries.go 85.53% <0.00%> (-1.09%) ⬇️
catalog/db_batch_entry_read.go 76.05% <0.00%> (-0.98%) ⬇️
catalog/model.go 76.92% <0.00%> (-0.86%) ⬇️
stats/collector.go 62.06% <0.00%> (-0.76%) ⬇️
block/local/adapter.go 5.71% <0.00%> (-0.74%) ⬇️
... and 38 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35278e4...ebe2ba2. Read the comment docs.

@arielshaqed arielshaqed self-requested a review October 13, 2020 14:22
Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

Thanks!

Please make a change on the server side, details inside. Do tag me (@ariels) on our Slack if you have any questions!

cmd/lakectl/cmd/repo.go Outdated Show resolved Hide resolved
Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

This looks good! Hadn't realized it would be this short :-)

Does this fix the error message? If you tested manually and could copy+paste the new error message into the PR, that would be great and I'll approve and pull over the weekend. Otherwise I'll do these steps on Sunday.

@@ -38,7 +38,9 @@ func (c *cataloger) CreateRepository(ctx context.Context, repository string, sto

// create repository with ref to branch
if _, err := tx.Exec(`INSERT INTO catalog_repositories (id,name,storage_namespace,creation_date,default_branch)
VALUES ($1,$2,$3,transaction_timestamp(),$4)`, repoID, repository, storageNamespace, branchID); err != nil {
VALUES ($1,$2,$3,transaction_timestamp(),$4)`, repoID, repository, storageNamespace, branchID); db.IsUniqueViolation(err) {
return nil, fmt.Errorf("%s %w", repository, db.ErrAlreadyExists)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("%s %w", repository, db.ErrAlreadyExists)
return nil, fmt.Errorf("create repository %s: %w", repository, db.ErrAlreadyExists)

(details the operation on the error message).

Copy link
Contributor Author

@ari-hacks ari-hacks Oct 22, 2020

Choose a reason for hiding this comment

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

Yup, I updated the comment above with a screenshot of the new error message - 'error creating repository:' is prefixed to the message already. 🙂

@arielshaqed
Copy link
Contributor

Sorry if the below is unclear:

This looks good! Hadn't realized it would be this short :-)

Short is good and contains fewer places for bugs to show up later. I like "short". "Short" is not the same as "easy". So thanks!

@arielshaqed arielshaqed linked an issue Oct 22, 2020 that may be closed by this pull request
Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

This is great, thanks!

@arielshaqed arielshaqed merged commit cf0454f into treeverse:master Oct 25, 2020
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.

SQL error is shown to the user
3 participants