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

Added canceled_on field to unified_jobs model #5610

Merged
merged 2 commits into from
Jan 14, 2020
Merged

Added canceled_on field to unified_jobs model #5610

merged 2 commits into from
Jan 14, 2020

Conversation

thedoubl3j
Copy link
Member

SUMMARY

Please see #5406 for previous comments/discussion about the decisions made.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • API
AWX VERSION
awx: 9.1.0

ADDITIONAL INFORMATION

Before, this would look like

"scm_type": "git",
"scm_url": "https://github.com/ansible/test-playbooks.git",
"scm_branch": "",
"scm_clean": false,
"scm_delete_on_update": false,
"credential": null,
"timeout": 0,
"unified_job_template": 3838,
"launch_type": "manual",
"status": "canceled",
"failed": true,
"started": null,
"finished": "2019-06-03T12:39:05.272329Z",
"elapsed": 0.0,
"job_args": "",
"job_cwd": "",
"job_env": {},
"job_explanation": "",
"execution_node": "",
"result_traceback": "",
"event_processing_finished": true,
"project": 3838,
"job_type": "check",

With this addition, a new field is added called canceled_on that displays the timestamp that the job was canceled based on the cancel_flag.

So it now will display something like

"created": "2020-01-07T19:37:08.997962Z",
            "modified": "2020-01-07T19:37:09.325185Z",
            "name": "test",
            "description": "",
            "unified_job_template": 9,
            "launch_type": "relaunch",
            "status": "failed",
            "failed": true,
            "started": "2020-01-07T19:37:09.491372Z",
            "finished": "2020-01-07T19:48:25.446239Z",
            "canceled_on": "2020-01-07T19:55:01.833860Z",
            "elapsed": 675.955,
            "job_explanation": "Task was marked as running in Tower but was not present in the job queue, so it has been marked as failed.",
            "execution_node": "awx",

@thedoubl3j
Copy link
Member Author

a big thanks again to @rooftopcellist @beeankha and @rebeccahhh for the help provided.

@@ -810,11 +817,18 @@ def save(self, *args, **kwargs):

# Sanity check: Has the job just completed? If so, mark down its
# completion time, and record its output to the database.
#import sdb
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this.

Copy link
Contributor

@ryanpetrello ryanpetrello left a comment

Choose a reason for hiding this comment

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

This seems pretty reasonable to me.

@mabashian @jakemcdermott can you think of anything we might want to do with this in the UI?

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@thedoubl3j
Copy link
Member Author

thedoubl3j commented Jan 8, 2020

I actually have a problem with it @ryanpetrello because this...is wrong

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

Copy link
Member

@AlanCoding AlanCoding left a comment

Choose a reason for hiding this comment

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

I love how simple this is. It needs to be in the serializer, but if it's easier to remove it from the summary_fields data to get tests passing, I would not object to that.

Copy link
Contributor

@ryanpetrello ryanpetrello left a comment

Choose a reason for hiding this comment

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

It looks like Alan has some minor feedback, but this looks great 🎉

Thanks @thedoubl3j !

@AlanCoding
Copy link
Member

My comments were only suggestions to get the test passing, that's the only blocker

@thedoubl3j
Copy link
Member Author

@AlanCoding so what do you think the next steps are? anything else we should add/remove/change?

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@AlanCoding
Copy link
Member

I think you need to rebase to get tests passing

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

thedoubl3j and others added 2 commits January 14, 2020 15:56
  - When a job is canceled, the canceled_on field will populate with date/time
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 78e2cd7 into ansible:devel Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants