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

Add management api for continuous export of branches #844

Merged
merged 6 commits into from
Oct 22, 2020

Conversation

arielshaqed
Copy link
Contributor

Part of #534.

@arielshaqed arielshaqed requested a review from guy-har October 19, 2020 13:55
- Remove a blank line
- Override interfacer change that removes semantic information in exchange for a poorly-named
  irrelevant interface.
@codecov-io
Copy link

codecov-io commented Oct 19, 2020

Codecov Report

Merging #844 into master will increase coverage by 2.10%.
The diff coverage is 76.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #844      +/-   ##
==========================================
+ Coverage   42.90%   45.01%   +2.10%     
==========================================
  Files         135      140       +5     
  Lines       10571    10842     +271     
==========================================
+ Hits         4536     4881     +345     
+ Misses       5444     5330     -114     
- Partials      591      631      +40     
Impacted Files Coverage Δ
catalog/cataloger.go 68.14% <ø> (ø)
api/api_controller.go 38.26% <66.66%> (+0.79%) ⬆️
catalog/cataloger_export.go 86.04% <86.04%> (ø)
config/logger.go 64.28% <0.00%> (-10.72%) ⬇️
catalog/views.go 97.01% <0.00%> (-1.65%) ⬇️
stats/collector.go 62.06% <0.00%> (-1.03%) ⬇️
config/config.go 33.55% <0.00%> (-0.23%) ⬇️
catalog/diff.go 18.51% <0.00%> (ø)
auth/metadata.go 0.00% <0.00%> (ø)
catalog/validate.go 94.44% <0.00%> (ø)
... and 16 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 4a51df8...4245f11. Read the comment docs.

if len(s) == 0 {
return nil, nil
}
regexpParts := strings.Split(s, "|")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Known issue (working on it while you review): This split is much too deep, e.g if you disjunct "a|b" and "c" it breaks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this, got rid of all the de-disjunctioning.

It is not possible to roundtrip generating and unparsing disjunctions from the database: the
regexp parser optimizes and rewrites portions of the regexp.  So we need a copy of the input
array stored in the database.  (Generating a regexp disjunction back from this array will be
easy, a small part of the deleted code did just that.)
@arielshaqed arielshaqed force-pushed the feature/534-management-api branch from 4d29c2e to 07afe46 Compare October 19, 2020 16:43
Not part of the server API so untested.  But may be used internally so needs testing.
@arielshaqed arielshaqed force-pushed the feature/534-management-api branch from 07afe46 to b8ca672 Compare October 19, 2020 20:40
Copy link
Contributor

@guy-har guy-har 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


deps.LogAction("set_continuous_export")

if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

what err does this handle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A long-gone err. Sorry. (But great flow analysis in the golang compiler)

if err = rows.StructScan(&rec); err != nil {
return nil, fmt.Errorf("scan configuration %+v: %w", rows, err)
}
fmt.Printf("[DEBUG] row %+v\n", rec)
Copy link
Contributor

Choose a reason for hiding this comment

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

should this still be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No 😠

@@ -1258,54 +1287,6 @@ paths:
schema:
$ref: "#/definitions/error"

/repositories/{repository}/inventory/s3/import:
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is "auto-generated" by make build (in the sense of "blindly copied because Go and WebPack each have their own uniquely correct view of the world, but that view is hopelessly naïve and wrong so we have to hack our away around it because explicit dependencies are very 1990s". @nopcoder can explain why it is committed.
The last person to touch swagger.yml just forgot to build it.
Mine is an exact copy:

ariels@ariels:~/Dev/lakeFS$ diff swagger.yml docs/assets/js/swagger.yml 

@@ -0,0 +1 @@
DROP TABLE catalog_branches_export;
Copy link
Contributor

Choose a reason for hiding this comment

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

IF EXISTS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see we do that everywhere, so did it here too. Not sure it makes anything safer.

Copy link
Contributor Author

@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; PTAL...


deps.LogAction("set_continuous_export")

if err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A long-gone err. Sorry. (But great flow analysis in the golang compiler)

@@ -0,0 +1 @@
DROP TABLE catalog_branches_export;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see we do that everywhere, so did it here too. Not sure it makes anything safer.

@@ -1258,54 +1287,6 @@ paths:
schema:
$ref: "#/definitions/error"

/repositories/{repository}/inventory/s3/import:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is "auto-generated" by make build (in the sense of "blindly copied because Go and WebPack each have their own uniquely correct view of the world, but that view is hopelessly naïve and wrong so we have to hack our away around it because explicit dependencies are very 1990s". @nopcoder can explain why it is committed.
The last person to touch swagger.yml just forgot to build it.
Mine is an exact copy:

ariels@ariels:~/Dev/lakeFS$ diff swagger.yml docs/assets/js/swagger.yml 

if err = rows.StructScan(&rec); err != nil {
return nil, fmt.Errorf("scan configuration %+v: %w", rows, err)
}
fmt.Printf("[DEBUG] row %+v\n", rec)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No 😠

@guy-har
Copy link
Contributor

guy-har commented Oct 21, 2020

LGTM

@arielshaqed arielshaqed merged commit 7a8ca25 into master Oct 22, 2020
@arielshaqed arielshaqed deleted the feature/534-management-api branch October 22, 2020 06:57
@arielshaqed
Copy link
Contributor Author

Thanks!

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.

3 participants