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

Invalidation Type restricted message could be better #6340

Closed
ocket8888 opened this issue Nov 8, 2021 · 0 comments · Fixed by #7517
Closed

Invalidation Type restricted message could be better #6340

ocket8888 opened this issue Nov 8, 2021 · 0 comments · Fixed by #7517
Labels
bug something isn't working as intended improvement The functionality exists but it could be improved in some way. low difficulty the estimated level of effort to resolve this issue is low low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops

Comments

@ocket8888
Copy link
Contributor

ocket8888 commented Nov 8, 2021

This Improvement request (usability, performance, tech debt, etc.) affects these Traffic Control components:

  • Traffic Ops

Current behavior:

When attempting to create a "REFETCH" Content Invalidation Job when no refetch_enabled Parameter exists (or is not set to a case-insensitive "true") yields the error:

{
	"alerts": [
		{
			"text": "InvalidationType is invalid",
			"level": "error"
		}
	]
}

Similarly, if you try to change the Invalidation Type of an existing Content Invalidation Job to "REFETCH" when it's disallowed, the message incorrectly reports that "REFRESH" is not allowed:

PUT /api/4.0/jobs?id=1 HTTP/1.1
User-Agent: python-requests/2.25.1
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 191

{
  "deliveryService": "demo1",
  "ttlHours": 72,
  "startTime": "2021-11-09T01:02:03Z",
  "assetUrl": "http://origin.infra.ciab.test/.+",
  "createdBy": "admin",
  "id": 1,
  "invalidationType": "REFETCH"
}

Response:

{
	"alerts": [
		{
			"text": "Invalidation Type REFRESH is disallowed",
			"level": "error"
		}
	]
}

New behavior:

Firstly, the field is called "invalidationType", not "InvalidationType" - but that's less important than that the value "REFETCH" is actually valid, just not allowed, and the error message doesn't give the user enough information to know what will cause the request to succeed.

Also, the response from a PUT request should not lie to the user.

@ocket8888 ocket8888 added Traffic Ops related to Traffic Ops low impact affects only a small portion of a CDN, and cannot itself break one improvement The functionality exists but it could be improved in some way. bug something isn't working as intended labels Nov 8, 2021
@ocket8888 ocket8888 added the low difficulty the estimated level of effort to resolve this issue is low label Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended improvement The functionality exists but it could be improved in some way. low difficulty the estimated level of effort to resolve this issue is low 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 a pull request may close this issue.

1 participant