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

Ignore delete permission error for manually deleted jobs (issue #2217) #2225

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

alexott
Copy link
Contributor

@alexott alexott commented Apr 18, 2023

Changes

Jobs API returns 400 "Bad request" for non-existent pipelines instead of 404 "Not Found", and this breaks recreation of permissions if job was manually deleted:

2023-04-18T10:02:07.317+0200 [DEBUG] provider.terraform-provider-databricks: GET /api/2.1/jobs/get?job_id=998654886170278
< HTTP/2.0 400 Bad Request
< {
<   "error_code": "INVALID_PARAMETER_VALUE",
<   "message": "Job 998654886170278 does not exist."
< }: timestamp=2023-04-18T10:02:07.317+0200

This fix explicitly ignores such errors. This fixes #2217

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • relevant acceptance tests are passing
  • using Go SDK

@alexott alexott requested review from a team April 18, 2023 08:19
@codecov-commenter
Copy link

Codecov Report

Merging #2225 (305e9e8) into master (c282084) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2225      +/-   ##
==========================================
+ Coverage   88.74%   88.75%   +0.01%     
==========================================
  Files         137      137              
  Lines       11290    11292       +2     
==========================================
+ Hits        10019    10022       +3     
  Misses        855      855              
+ Partials      416      415       -1     
Impacted Files Coverage Δ
permissions/resource_permissions.go 89.36% <100.00%> (+0.52%) ⬆️

@nfx nfx merged commit 1e41c36 into master Apr 24, 2023
@nfx nfx deleted the issue-2217 branch April 24, 2023 14:48
@nfx nfx mentioned this pull request May 5, 2023
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.

[ISSUE] Issue deleting a job from the UI, creating corrupted state
3 participants