Skip to content

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Aug 26, 2021

Signed-off-by: Ben Ye ben.ye@bytedance.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@yeya24 yeya24 changed the title Support delete-resource command in cli feat: Support delete-resource command in cli Aug 26, 2021
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
@yeya24 yeya24 force-pushed the support-delete-resource branch from 91f7f1b to b50ad53 Compare August 26, 2021 18:49
@jannfis
Copy link
Member

jannfis commented Aug 30, 2021

Thanks @yeya24! This looks like it could use some end-to-end tests along with it, would you be willing to add some?

Copy link
Collaborator

@alexmt alexmt 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. Thank you for the useful feature!

@codecov
Copy link

codecov bot commented Sep 3, 2021

Codecov Report

Merging #7093 (1050411) into master (44520ea) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7093      +/-   ##
==========================================
- Coverage   41.08%   41.06%   -0.03%     
==========================================
  Files         158      158              
  Lines       21349    21274      -75     
==========================================
- Hits         8772     8736      -36     
+ Misses      11311    11285      -26     
+ Partials     1266     1253      -13     
Impacted Files Coverage Δ
cmd/argocd/commands/app.go 0.54% <0.00%> (-0.02%) ⬇️
server/application/application.go 32.11% <0.00%> (-0.66%) ⬇️
server/server.go 54.65% <0.00%> (-0.20%) ⬇️
util/settings/settings.go 47.15% <0.00%> (ø)
pkg/apis/application/v1alpha1/hack.go 0.00% <0.00%> (ø)
server/repository/repository.go 35.88% <0.00%> (+0.11%) ⬆️
server/logout/logout.go 77.77% <0.00%> (+0.41%) ⬆️
controller/cache/info.go 65.33% <0.00%> (+1.82%) ⬆️

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 44520ea...1050411. Read the comment docs.

@alexmt
Copy link
Collaborator

alexmt commented Sep 3, 2021

Codegen CI task failed. You can fix it using make clidocsgen. I agree with @jannfis about e2e test. We need something like

func TestAppCreation(t *testing.T) {

E.g.

func TestDeleteAppResource(t *testing.T) {
	ctx := Given(t)

	ctx.
		Path(guestbookPath).
		When().
		Create().
		Sync().
		Then().
		Expect(SyncStatusIs(SyncStatusCodeInSync)).
		When().
		And(func(app *Application) {
			output, err := RunCli("app", "delete-resource", Name())
			assert.NoError(t, err)
                         // verify that resource is deleted
		}).
}

Signed-off-by: Ben Ye <ben.ye@bytedance.com>
@yeya24
Copy link
Contributor Author

yeya24 commented Sep 5, 2021

Updated the pr. PTAL again, thank you. @alexmt @jannfis

ctx.
Path(guestbookPath).
When().
Create().
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the test is failing because .Sync() is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Updated.

Signed-off-by: Ben Ye <ben.ye@bytedance.com>
Copy link
Collaborator

@alexmt alexmt left a comment

Choose a reason for hiding this comment

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

LGTM

@alexmt alexmt merged commit be884d2 into argoproj:master Sep 6, 2021
plakyda-codefresh pushed a commit to plakyda-codefresh/argo-cd that referenced this pull request Sep 28, 2021
* feat: support delete-resource command in argocd cli

Signed-off-by: Ben Ye <ben.ye@bytedance.com>

* add E2E test and fix documents

Signed-off-by: Ben Ye <ben.ye@bytedance.com>

* sync app

Signed-off-by: Ben Ye <ben.ye@bytedance.com>
Signed-off-by: viktorplakida <plakyda1@gmail.com>
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