nautobot / nautobot-app-golden-config

Golden Configuration App for Nautobot.
https://docs.nautobot.com/projects/golden-config/en/latest/
Other
98 stars 56 forks source link

adding logic to handle jobs requiring approvals #718

Closed whitej6 closed 6 months ago

whitej6 commented 7 months ago

Closes: #710

Previously jobs that required approval were not accounted for. This accounts for job approvals and an implicit else on 2XX response on job launch for flows that are were not accounted for and logs the response to console.

image

image

jeffkala commented 7 months ago

The one miss here is that if you do the steps below, the job execution fails because in essense it requires you to approve the "configplan" status first. Perhaps we hook into the job approval to also "approve" the status of the configplan?

Steps to recreate:

  1. Create a ConfigPlan
  2. Redirects to the job approval page.
  3. Change user, approve the job
  4. Click "continue" on popup about job being immediatly executed.
  5. Got to job result and notice the configplan "self" logic actually resulted in the job not running due to
 ['`E3025:` Cannot deploy configuration(s). One or more config plans are not approved.']}

Can we: Have the job-approval "approval" also automatically change the configplan status to "approved"