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

Fix CLI to display removed/renamed jobs #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

suonlight
Copy link
Contributor

@suonlight suonlight commented Oct 13, 2019

Summary

When we remove the job Jobs::SayHello, but the job is still
persisted on Redis. The CLI list/show will raise an error. This PR is to fix
this error which allows the CLI to display removed/renamed jobs.

Before

❯ ./bin/gush show <workflow-id>
~/.asdf/installs/ruby/2.4.6/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/inflector/methods.rb:285:in `const_get': uninitialized constant Jobs::SayHello (NameError)

After

[✓] Removed - Jobs::SayHello|059349f6-5629-4f93-83bb-db52659b9b75
[✓] Removed - Jobs::SayHello|6343f0ab-a295-4a5b-b48c-96660e5691c2
[✓] Removed - Jobs::SayHello|6874b417-ee47-4701-8b5e-d076624b05ad
[✓] Removed - Jobs::SayHello|fddd49bd-984a-4c7c-b31c-74676fd65877
[✓] Removed - Jobs::SayHello|fa59fc43-da22-483b-84f5-f7f1c34bf7e8
[✓] Removed - Jobs::SayHello|df8dc75d-4513-4687-a520-e2a572ba2a01
[✓] Removed - Jobs::SayHello|82cc8060-d31b-471d-9a12-6e6e092f23e3
[✓] Removed - Jobs::SayHello|12f495c3-0f8d-458e-af32-c392b6a9b3ef
[✓] Removed - Jobs::SayHello|fba46058-d133-424d-8514-d4bfe02486f0
[✓] Removed - Jobs::SayHello|c9ebae45-077f-4548-944f-49d17c88637c

# Summary

When we remove the job `Jobs::SayHello`, but the job is still
persisted on Redis. The cli will raise an error. This PR is to fix
this error which allows the cli to display removed/renamed jobs.

## Before

```
❯ ./bin/gush show <workflow-id>
/Users/employmenthero/.asdf/installs/ruby/2.4.6/lib/ruby/gems/2.4.0/gems/activesupport-5.2.3/lib/active_support/inflector/methods.rb:285:in `const_get': uninitialized constant
Jobs::SayHello (NameError)
```

## After

```
[✓] Removed - Jobs::SayHello|059349f6-5629-4f93-83bb-db52659b9b75
[✓] Removed - Jobs::SayHello|6343f0ab-a295-4a5b-b48c-96660e5691c2
[✓] Removed - Jobs::SayHello|6874b417-ee47-4701-8b5e-d076624b05ad
[✓] Removed - Jobs::SayHello|fddd49bd-984a-4c7c-b31c-74676fd65877
[✓] Removed - Jobs::SayHello|fa59fc43-da22-483b-84f5-f7f1c34bf7e8
[✓] Removed - Jobs::SayHello|df8dc75d-4513-4687-a520-e2a572ba2a01
[✓] Removed - Jobs::SayHello|82cc8060-d31b-471d-9a12-6e6e092f23e3
[✓] Removed - Jobs::SayHello|12f495c3-0f8d-458e-af32-c392b6a9b3ef
[✓] Removed - Jobs::SayHello|fba46058-d133-424d-8514-d4bfe02486f0
[✓] Removed - Jobs::SayHello|c9ebae45-077f-4548-944f-49d17c88637c
```
@thukim
Copy link
Contributor

thukim commented Oct 13, 2019

Should we bump the patch version for this?

@suonlight
Copy link
Contributor Author

@thukim: I think @pokonski will review the PR and bump version later.

@pokonski
Copy link
Contributor

Is the use case here when you change the structure of the workflow and stop triggering one of the jobs? I think the error is a good indication something is wrong - why is the job gone when you still have workflows relying on it?

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