Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Fix json response for invalid invalidation job. Moved CHANGELOG entry#6328

Merged
mattjackson220 merged 1 commit intoapache:masterfrom
tcfdev:bugfix/jobs-json-response
Nov 4, 2021
Merged

Fix json response for invalid invalidation job. Moved CHANGELOG entry#6328
mattjackson220 merged 1 commit intoapache:masterfrom
tcfdev:bugfix/jobs-json-response

Conversation

@tcfdev
Copy link
Copy Markdown
Collaborator

@tcfdev tcfdev commented Nov 3, 2021

Addresses an issue discovered in testing the TO v4.0 /jobs endpoint. The validation of the incoming job was wrapping the alert and error response inside another alert and error response.

Incorrect response:

{
  "alerts": [
    {
      "text": "{\"alerts\":[{\"text\":\"deliveryService: cannot be blank.\",\"level\":\"error\"}]}\n",
      "level": "error"
    }
  ]
}

Fixed response:

{
  "alerts": [
    {
      "text": "deliveryService: cannot be blank.",
      "level": "error"
    }
  ]
}

Also moved a CHANGELOG entry for the REFETCH feature into the correct location for the CHANGELOG.


Which Traffic Control components are affected by this PR?

  • Traffic Ops

What is the best way to verify this PR?

Run Traffic Ops and attempt to POST a new invalidation request to the /jobs endpoint. The following json will trigger a validation error, alert response:

{
	"startTime": "2021-11-05T16:24:00.370Z",
	"regex": "/path/to/some/content\\.jpg",
	"ttlHours": 24,
	"invalidationType": "REFRESH"
}

PR submission checklist

  • This PR has tests - Does not have a functional aspect, only asthetic.
  • This PR has documentation - No documented logic is changed, added, or deleted.
  • This PR has a CHANGELOG.md entry
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)

@zrhoffman
Copy link
Copy Markdown
Member

Also moved a CHANGELOG entry for the REFETCH feature into the correct location for the CHANGELOG.

If you put that in a separate PR, I'll merge it right away

Copy link
Copy Markdown
Contributor

@srijeet0406 srijeet0406 left a comment

Choose a reason for hiding this comment

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

LGTM! Manual tests pass. API and unit tests pass.

@dneuman64
Copy link
Copy Markdown
Contributor

retest this please

@zrhoffman
Copy link
Copy Markdown
Member

retest this please

Failing due to the ATS RPM version-calculating issue fixed by #6329

@rawlinp rawlinp added bug something isn't working as intended low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops labels Nov 4, 2021
@zrhoffman
Copy link
Copy Markdown
Member

In order for CI to pass, #6328 needs to be rebased onto the apache:master branch now that the CI fix in #6329 is merged:

git remote add apache git@github.com:apache/trafficcontrol.git
git fetch apache
git rebase apache
git push your-fork your-branch --force

@tcfdev tcfdev force-pushed the bugfix/jobs-json-response branch from 5f1111e to 56204c7 Compare November 4, 2021 21:04
@mattjackson220 mattjackson220 merged commit 05f7866 into apache:master Nov 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug something isn't working as intended low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants