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

make registry apply accept a list of files #1101

Merged
merged 7 commits into from
Mar 16, 2023

Conversation

theganyo
Copy link
Member

Fixes #1097

@codecov
Copy link

codecov bot commented Mar 16, 2023

Codecov Report

Merging #1101 (24daa92) into main (e0951df) will decrease coverage by 0.02%.
The diff coverage is 48.64%.

@@            Coverage Diff             @@
##             main    #1101      +/-   ##
==========================================
- Coverage   68.26%   68.24%   -0.02%     
==========================================
  Files         145      145              
  Lines       11984    11993       +9     
==========================================
+ Hits         8181     8185       +4     
- Misses       3096     3100       +4     
- Partials      707      708       +1     
Impacted Files Coverage Δ
cmd/registry/patch/apply.go 72.90% <41.66%> (+0.17%) ⬆️
cmd/registry/cmd/apply/apply.go 69.56% <61.53%> (-6.76%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@theganyo theganyo requested a review from timburks March 16, 2023 17:29
Args: cobra.NoArgs,
Long: "Apply YAML to the API Registry by files / folder names or stdin. " +
"Resources will be created if they don't exist yet. " +
"Multiple files may be specified in -f separated by commas or by repeating the -f flag." +
Copy link
Contributor

Choose a reason for hiding this comment

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

Does kubectl apply -f split on commas? I didn't know about that.

Copy link
Member Author

Choose a reason for hiding this comment

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

No idea if kubectl does, but this does.

Copy link
Contributor

Choose a reason for hiding this comment

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

If kubectl doesn't do it, would you mind removing that? It's duplicative of multiple -f options, so it's only a small usability improvement.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove the comment, but that's just the way that cobra works.

})
if err != nil {
return err
}
}
return patches.run(ctx, jobs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just double-checking: because we collect all the inputs before we call this, there's no sensitivity to the ordering of file names, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

What is your specific concern?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't want a child resource to fail to apply because its parent hasn't been applied yet. That's already addressed in patches.run() so since we're only callling patches.run() once for all the inputs, we should be good.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Nothing has changed wrt. how a file is added to patches.run() other than now multiples paths (and their subpaths) may be added before the run. That said, and as a separate issue, I don't see the dependency case checked in patch_test.go - or am I missing it?

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, sg. We might not be checking the dependency in the tests.

@timburks timburks self-requested a review March 16, 2023 22:26
@theganyo theganyo merged commit 6781b69 into apigee:main Mar 16, 2023
@theganyo theganyo deleted the theganyo/issue1097 branch March 16, 2023 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Registry tool: can registry apply accept a list of files?
2 participants