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

Fix /deliveryservices/{{ID}}/servers and /deliveryservices/{{ID}}/servers/eligible to use RFC3339 timestamps #7660

Merged

Conversation

gbkannan89
Copy link
Contributor

@gbkannan89 gbkannan89 commented Jul 18, 2023

Related:#5911


Which Traffic Control components are affected by this PR?

  • Documentation
  • Traffic Ops

What is the best way to verify this PR?

Response object with date must be in RFC3339-format date strings.

In deliveryservices/{{ID}}/servers - expected lastUpdated response in RFC3339-format date strings.

HTTP/1.1 GET /api/5.0/deliveryservices/{{ID}}/servers
Content-Length: 0
{
	"response": [{
		"cachegroup": "CDN_in_a_Box_Edge",
		"cachegroupId": 7,
		"cdnId": 2,
		"cdnName": "CDN-in-a-Box",
		"domainName": "infra.ciab.test",
		"guid": null,
		"hostName": "edge",
		"httpsPort": 443,
		"id": 10,
		"iloIpAddress": "",
		"iloIpGateway": "",
		"iloIpNetmask": "",
		"iloPassword": "",
		"iloUsername": "",
		"lastUpdated": "2018-11-14T21:50:03.009954Z",
		"mgmtIpAddress": "",
		"mgmtIpGateway": "",
		"mgmtIpNetmask": "",
		"offlineReason": "",
		"physLocation": "Apachecon North America 2018",
		"physLocationId": 1,
		"profileNames": ["ATS_EDGE_TIER_CACHE"],
		"rack": "",
		"routerHostName": "",
		"routerPortName": "",
		"status": "REPORTED",
		"statusId": 3,
		"tcpPort": 80,
		"type": "EDGE",
		"typeId": 11,
		"updPending": false,
		"interfaces": [{
			"ipAddresses": [{
					"address": "172.16.239.100",
					"gateway": "172.16.239.1",
					"service_address": true
				},
				{
					"address": "fc01:9400:1000:8::100",
					"gateway": "fc01:9400:1000:8::1",
					"service_address": true
				}
			],
			"max_bandwidth": 0,
			"monitor": true,
			"mtu": 1500,
			"name": "eth0"
		}]
	}]
}

In deliveryservices/{{ID}}/servers/eligible - expected lastUpdated in response RFC3339-format date strings.

HTTP/1.1 GET /api/5.0/deliveryservices/{{ID}}/servers/eligible
Content-Length: 0
{ "response": [
    {
        "cachegroup": "CDN_in_a_Box_Edge",
        "cachegroupId": 7,
        "cdnId": 2,
        "cdnName": "CDN-in-a-Box",
        "domainName": "infra.ciab.test",
        "guid": null,
        "hostName": "edge",
        "httpsPort": 443,
        "id": 10,
        "iloIpAddress": "",
        "iloIpGateway": "",
        "iloIpNetmask": "",
        "iloPassword": "",
        "iloUsername": "",
        "lastUpdated": "2018-10-30T21:50:03.009954Z",
        "mgmtIpAddress": "",
        "mgmtIpGateway": "",
        "mgmtIpNetmask": "",
        "offlineReason": "",
        "physLocation": "Apachecon North America 2018",
        "physLocationId": 1,
        "profile": "ATS_EDGE_TIER_CACHE",
        "profileDesc": "Edge Cache - Apache Traffic Server",
        "profileId": 9,
        "rack": "",
        "routerHostName": "",
        "routerPortName": "",
        "status": "REPORTED",
        "statusId": 3,
        "tcpPort": 80,
        "type": "EDGE",
        "typeId": 11,
        "updPending": false,
        "interfaces": [{
            "ipAddresses": [
                {
                    "address": "172.16.239.100",
                    "gateway": "172.16.239.1",
                    "service_address": true
                },
                {
                    "address": "fc01:9400:1000:8::100",
                    "gateway": "fc01:9400:1000:8::1",
                    "service_address": true
                }
            ],
            "max_bandwidth": 0,
            "monitor": true,
            "mtu": 1500,
            "name": "eth0"
        }]
    }
]}

PR submission checklist

  • This PR has tests
  • This PR has documentation
  • This PR has a CHANGELOG.md entry
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY

@gbkannan89 gbkannan89 marked this pull request as ready for review July 18, 2023 11:27
@ericholguin ericholguin added Traffic Ops related to Traffic Ops low impact affects only a small portion of a CDN, and cannot itself break one tech debt rework due to choosing easy/limited solution labels Jul 18, 2023
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #7660 (ad1977f) into master (75ec56f) will decrease coverage by 35.24%.
Report is 34 commits behind head on master.
The diff coverage is 8.40%.

@@              Coverage Diff              @@
##             master    #7660       +/-   ##
=============================================
- Coverage     65.05%   29.82%   -35.24%     
  Complexity       98       98               
=============================================
  Files           314      794      +480     
  Lines         12365    84943    +72578     
  Branches        907      908        +1     
=============================================
+ Hits           8044    25331    +17287     
- Misses         3968    57481    +53513     
- Partials        353     2131     +1778     
Flag Coverage Δ
golib_unit 48.10% <0.00%> (?)
grove_unit 4.60% <ø> (?)
t3c_unit 4.95% <5.88%> (?)
traffic_monitor_unit 21.30% <0.00%> (?)
traffic_ops_integration 69.39% <86.36%> (-0.03%) ⬇️
traffic_ops_unit 22.55% <3.13%> (?)
traffic_portal_v2 73.91% <78.57%> (+0.13%) ⬆️
traffic_stats_unit 10.14% <ø> (?)
unit_tests 26.94% <6.08%> (-46.84%) ⬇️
v3 57.79% <ø> (ø)
v4 79.18% <ø> (ø)
v5 78.52% <86.36%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
cache-config/t3c-apply/config/config.go 0.00% <0.00%> (ø)
cache-config/t3c-apply/t3c-apply.go 0.00% <0.00%> (ø)
...ared/navigation/tp-sidebar/tp-sidebar.component.ts 59.64% <0.00%> (-3.32%) ⬇️
...tal/traffic-portal/src/environments/environment.ts 100.00% <ø> (ø)
lib/go-tc/deliveryservice_servers.go 0.00% <0.00%> (ø)
lib/go-tc/federation_resolver.go 45.45% <0.00%> (ø)
traffic_monitor/tmclient/tmclient.go 0.00% <0.00%> (ø)
...ops/traffic_ops_golang/deliveryservice/eligible.go 55.27% <0.00%> (ø)
...fic_ops/traffic_ops_golang/deliveryservice/keys.go 31.86% <0.00%> (ø)
...ffic_ops_golang/deliveryservice/servers/servers.go 31.76% <0.00%> (ø)
... and 21 more

... and 466 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

lib/go-tc/deliveryservice_servers.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ocket8888 ocket8888 left a comment

Choose a reason for hiding this comment

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

Also missing the other usages in the v5 client, as well as associated testing changes

lib/go-tc/federation_resolver.go Outdated Show resolved Hide resolved
lib/go-tc/federation_resolver.go Outdated Show resolved Hide resolved
lib/go-tc/federation_resolver.go Outdated Show resolved Hide resolved
lib/go-tc/federation_resolver.go Outdated Show resolved Hide resolved
traffic_ops/traffic_ops_golang/deliveryservice/eligible.go Outdated Show resolved Hide resolved
traffic_ops/traffic_ops_golang/deliveryservice/eligible.go Outdated Show resolved Hide resolved
lib/go-tc/deliveryservice_servers.go Outdated Show resolved Hide resolved
@ocket8888 ocket8888 changed the title To delivery service rfc time format v5 Fix /deliveryservices/{{ID}}/servers and /deliveryservices/{{ID}}/servers/eligible to use RFC3339 timestamps Jul 28, 2023
Copy link
Contributor

@ocket8888 ocket8888 left a comment

Choose a reason for hiding this comment

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

Also missing the other usages in the v5 client, as well as associated testing changes

lib/go-tc/deliveryservice_servers.go Outdated Show resolved Hide resolved
lib/go-tc/deliveryservice_servers.go Outdated Show resolved Hide resolved
lib/go-tc/deliveryservice_servers.go Outdated Show resolved Hide resolved
@ocket8888 ocket8888 merged commit 33d8179 into apache:master Jul 31, 2023
43 of 44 checks passed
@gbkannan89 gbkannan89 deleted the to-delivery-service-rfc-time-format-v5 branch August 28, 2023 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low impact affects only a small portion of a CDN, and cannot itself break one tech debt rework due to choosing easy/limited solution Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants