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

Fix MaxRevalDurationDays validation for invalidation jobs#4718

Merged
ocket8888 merged 4 commits intoapache:masterfrom
rawlinp:fix-max-reval-days
May 27, 2020
Merged

Fix MaxRevalDurationDays validation for invalidation jobs#4718
ocket8888 merged 4 commits intoapache:masterfrom
rawlinp:fix-max-reval-days

Conversation

@rawlinp
Copy link
Copy Markdown
Contributor

@rawlinp rawlinp commented May 26, 2020

What does this PR (Pull Request) do?

Fix the validation of invalidation job TTLs per the maxRevalDurationsDays parameter. The broken validation was not converting days to hours before doing the validation. This PR also adds that validation to the /jobs endpoints because it was missing.

  • This PR is not related to any Issue

Which Traffic Control components are affected by this PR?

  • Traffic Ops

What is the best way to verify this PR?

Run the unit tests and TO API tests. Verify they pass. Manually POST /api/1.4/user/current/jobs with a ttl that higher than the value of the maxRevalDurationDays parameter (x 24). Example request json below:

{
  "startTime": "2020-05-26 16:48:32",
  "dsId": 442,
  "regex": "/foobar",
  "ttl": 3000
}

If this is a bug fix, what versions of Traffic Control are affected?

  • master
  • 4.0.0
  • 4.1.0-RC0

The following criteria are ALL met by this PR

  • This PR includes tests
  • bugfix, no docs necessary
  • This PR includes an update to CHANGELOG.md
  • This PR includes any and all required license headers
  • This PR ensures that database migration sequence is correct OR this PR does not include a database migration
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)

@rawlinp rawlinp added Traffic Ops related to Traffic Ops regression bug a bug in existing functionality introduced by a new version 4.1.x-backport-candidate labels May 26, 2020
@zrhoffman
Copy link
Copy Markdown
Member

Branch has a merge conflict in the changelog

@rawlinp
Copy link
Copy Markdown
Contributor Author

rawlinp commented May 26, 2020

Thanks! Merge conflict resolved.

Copy link
Copy Markdown
Member

@zrhoffman zrhoffman left a comment

Choose a reason for hiding this comment

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

  • API tests pass
  • gofmt is happy with the added code
  • Code looks good
    👍

@ocket8888 ocket8888 merged commit 94e4ede into apache:master May 27, 2020
@rawlinp rawlinp deleted the fix-max-reval-days branch May 27, 2020 16:44
rawlinp added a commit to rawlinp/trafficcontrol that referenced this pull request May 28, 2020
* Fix MaxRevalDurationDays validation for invalidation jobs

* Address review feedback

* unindent

(cherry picked from commit 94e4ede)
rawlinp added a commit that referenced this pull request May 28, 2020
)

* Fix MaxRevalDurationDays validation for invalidation jobs

* Address review feedback

* unindent

(cherry picked from commit 94e4ede)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

regression bug a bug in existing functionality introduced by a new version Traffic Ops related to Traffic Ops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants