You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "shamrickus (via GitHub)" <gi...@apache.org> on 2023/06/07 14:32:53 UTC
[GitHub] [trafficcontrol] shamrickus opened a new pull request, #7562: TPv2 Upgrade Angular to 16
shamrickus opened a new pull request, #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562
<!--
Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
If this closes or relates to an existing issue, please reference it using one of the following:
Closes: #ISSUE
Related: #ISSUE
If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://apache.org/security regarding vulnerability disclosure.
-->
This PR updates Angular to version 16 from 15.
<!-- **^ Add meaningful description above** --><hr/>
## Which Traffic Control components are affected by this PR?
<!-- Please delete all components from this list that are NOT affected by this PR.
Feel free to add the name of a tool or script that is affected but not on the list.
-->
- Traffic Portal v2
## What is the best way to verify this PR?
Ensure build/lint/tests pass. Make sure TPv2 works and looks the same as before. Also consult the upgrading guide to ensure nothing was missed see [this](https://angular.io/guide/update-to-version-16)
<!-- Please include here ALL the steps necessary to test your PR.
If your PR has tests (and most should), provide the steps needed to run the tests.
If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
<!-- Delete this section if the PR is not a bugfix, or if the bug is only in the master branch.
Examples:
- 5.1.2
- 5.1.3 (RC1)
-->
## PR submission checklist
- [x] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
- [ ] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
- [x] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should ha e a changelog entry. -->
- [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] codecov[bot] commented on pull request #7562: TPv2 Upgrade Angular to 16
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562#issuecomment-1581014370
## [Codecov](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#7562](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (2a798e0) into [master](https://app.codecov.io/gh/apache/trafficcontrol/commit/2e995e734d4eeade97616cd486e000cae2038035?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (2e995e7) will **increase** coverage by `37.64%`.
> The diff coverage is `66.66%`.
```diff
@@ Coverage Diff @@
## master #7562 +/- ##
=============================================
+ Coverage 27.74% 65.39% +37.64%
Complexity 98 98
=============================================
Files 686 312 -374
Lines 78128 12199 -65929
Branches 90 885 +795
=============================================
- Hits 21675 7977 -13698
+ Misses 54396 3873 -50523
+ Partials 2057 349 -1708
```
| Flag | Coverage Δ | |
|---|---|---|
| golib_unit | `?` | |
| grove_unit | `?` | |
| t3c_unit | `?` | |
| traffic_monitor_unit | `?` | |
| traffic_ops_unit | `?` | |
| traffic_portal_v2 | `74.95% <66.66%> (?)` | |
| traffic_stats_unit | `?` | |
| unit_tests | `74.95% <66.66%> (+50.54%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...tal/traffic-portal/src/app/api/base-api.service.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvYXBpL2Jhc2UtYXBpLnNlcnZpY2UudHM=) | `100.00% <ø> (ø)` | |
| [...al/src/app/api/testing/delivery-service.service.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvYXBpL3Rlc3RpbmcvZGVsaXZlcnktc2VydmljZS5zZXJ2aWNlLnRz) | `63.00% <ø> (ø)` | |
| [...re/cache-groups/asns/table/asns-table.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9jYWNoZS1ncm91cHMvYXNucy90YWJsZS9hc25zLXRhYmxlLmNvbXBvbmVudC50cw==) | `47.05% <ø> (ø)` | |
| [...s/coordinates/table/coordinates-table.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9jYWNoZS1ncm91cHMvY29vcmRpbmF0ZXMvdGFibGUvY29vcmRpbmF0ZXMtdGFibGUuY29tcG9uZW50LnRz) | `100.00% <ø> (ø)` | |
| [...roups/divisions/table/divisions-table.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9jYWNoZS1ncm91cHMvZGl2aXNpb25zL3RhYmxlL2RpdmlzaW9ucy10YWJsZS5jb21wb25lbnQudHM=) | `100.00% <ø> (ø)` | |
| [.../src/app/core/change-logs/change-logs.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9jaGFuZ2UtbG9ncy9jaGFuZ2UtbG9ncy5jb21wb25lbnQudHM=) | `100.00% <ø> (ø)` | |
| [.../core/deliveryservice/ds-card/ds-card.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9kZWxpdmVyeXNlcnZpY2UvZHMtY2FyZC9kcy1jYXJkLmNvbXBvbmVudC50cw==) | `82.25% <ø> (ø)` | |
| [...ore/parameters/table/parameters-table.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9wYXJhbWV0ZXJzL3RhYmxlL3BhcmFtZXRlcnMtdGFibGUuY29tcG9uZW50LnRz) | `93.75% <ø> (ø)` | |
| [.../profiles/profile-table/profile-table.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9wcm9maWxlcy9wcm9maWxlLXRhYmxlL3Byb2ZpbGUtdGFibGUuY29tcG9uZW50LnRz) | `82.50% <ø> (ø)` | |
| [...ore/servers/capabilities/capabilities.component.ts](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXhwZXJpbWVudGFsL3RyYWZmaWMtcG9ydGFsL3NyYy9hcHAvY29yZS9zZXJ2ZXJzL2NhcGFiaWxpdGllcy9jYXBhYmlsaXRpZXMuY29tcG9uZW50LnRz) | `100.00% <ø> (ø)` | |
| ... and [16 more](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
... and [561 files with indirect coverage changes](https://app.codecov.io/gh/apache/trafficcontrol/pull/7562/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] shamrickus commented on pull request #7562: TPv2 Upgrade Angular to 16
Posted by "shamrickus (via GitHub)" <gi...@apache.org>.
shamrickus commented on PR #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562#issuecomment-1589562264
Not sure why the E2E tests are failing, should be using chromedriver 114 and they pass locally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] shamrickus commented on a diff in pull request #7562: TPv2 Upgrade Angular to 16
Posted by "shamrickus (via GitHub)" <gi...@apache.org>.
shamrickus commented on code in PR #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562#discussion_r1228192715
##########
experimental/traffic-portal/src/app/guards/authenticated-guard.service.ts:
##########
@@ -12,15 +12,14 @@
* limitations under the License.
*/
import { Injectable } from "@angular/core";
-import type { CanActivate, CanLoad } from "@angular/router";
import { CurrentUserService } from "src/app/shared/current-user/current-user.service";
/**
* AuthenticationGuard ensures that the user is logged in.
*/
@Injectable()
-export class AuthenticatedGuard implements CanActivate, CanLoad {
+export class AuthenticatedGuard {
Review Comment:
Yes, these don't exist anymore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 merged pull request #7562: TPv2 Upgrade Angular to 16
Posted by "ocket8888 (via GitHub)" <gi...@apache.org>.
ocket8888 merged PR #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] shamrickus commented on a diff in pull request #7562: TPv2 Upgrade Angular to 16
Posted by "shamrickus (via GitHub)" <gi...@apache.org>.
shamrickus commented on code in PR #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562#discussion_r1228224409
##########
experimental/traffic-portal/src/app/utils/index.spec.ts:
##########
@@ -99,7 +99,7 @@ describe("Typing utility functions", () => {
it("should check homogenous array types correctly", () => {
const a = {};
expect(isArray(a)).toBeFalse();
- const b = new Array();
+ const b: unknown[] = [];
Review Comment:
It was a linting rule from the recommended (which is now removed), but for the record I think this change makes sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #7562: TPv2 Upgrade Angular to 16
Posted by "ocket8888 (via GitHub)" <gi...@apache.org>.
ocket8888 commented on code in PR #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562#discussion_r1228643976
##########
experimental/traffic-portal/src/app/utils/index.spec.ts:
##########
@@ -99,7 +99,7 @@ describe("Typing utility functions", () => {
it("should check homogenous array types correctly", () => {
const a = {};
expect(isArray(a)).toBeFalse();
- const b = new Array();
+ const b: unknown[] = [];
Review Comment:
well it's technically incorrect. Before the change, b was `Array<never>`, and after it's `Array<unknown>`. The way it's being used that doesn't matter, but it does seem odd to me that they would add that "fixer".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] github-code-scanning[bot] commented on a diff in pull request #7562: TPv2 Upgrade Angular to 16
Posted by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562#discussion_r1221714674
##########
experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts:
##########
@@ -37,17 +37,17 @@
/**
* A regular expression that matches character strings that are illegal in `xml_id`s
*/
-const XML_ID_SANITIZE = /[^a-z0-9\-]+/g;
+const XML_ID_SANITIZE = /[^a-z0-9-]+/g;
/**
* A regular expression that matches a valid xml_id
*/
-const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/;
+const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
/**
* A regular expression that matches a valid hostname
*/
-const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/;
+const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/;
Review Comment:
## Overly permissive regular expression range
Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\].
[Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/271)
##########
experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts:
##########
@@ -37,17 +37,17 @@
/**
* A regular expression that matches character strings that are illegal in `xml_id`s
*/
-const XML_ID_SANITIZE = /[^a-z0-9\-]+/g;
+const XML_ID_SANITIZE = /[^a-z0-9-]+/g;
/**
* A regular expression that matches a valid xml_id
*/
-const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/;
+const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
/**
* A regular expression that matches a valid hostname
*/
-const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/;
+const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/;
Review Comment:
## Overly permissive regular expression range
Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\].
[Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/269)
##########
experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts:
##########
@@ -37,17 +37,17 @@
/**
* A regular expression that matches character strings that are illegal in `xml_id`s
*/
-const XML_ID_SANITIZE = /[^a-z0-9\-]+/g;
+const XML_ID_SANITIZE = /[^a-z0-9-]+/g;
/**
* A regular expression that matches a valid xml_id
*/
-const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/;
+const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
/**
* A regular expression that matches a valid hostname
*/
-const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/;
+const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/;
Review Comment:
## Overly permissive regular expression range
Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\].
[Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/272)
##########
experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts:
##########
@@ -37,17 +37,17 @@
/**
* A regular expression that matches character strings that are illegal in `xml_id`s
*/
-const XML_ID_SANITIZE = /[^a-z0-9\-]+/g;
+const XML_ID_SANITIZE = /[^a-z0-9-]+/g;
/**
* A regular expression that matches a valid xml_id
*/
-const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/;
+const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
/**
* A regular expression that matches a valid hostname
*/
-const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/;
+const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/;
Review Comment:
## Overly permissive regular expression range
Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\].
[Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/273)
##########
experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts:
##########
@@ -37,17 +37,17 @@
/**
* A regular expression that matches character strings that are illegal in `xml_id`s
*/
-const XML_ID_SANITIZE = /[^a-z0-9\-]+/g;
+const XML_ID_SANITIZE = /[^a-z0-9-]+/g;
/**
* A regular expression that matches a valid xml_id
*/
-const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/;
+const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
/**
* A regular expression that matches a valid hostname
*/
-const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/;
+const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/;
Review Comment:
## Overly permissive regular expression range
Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\].
[Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/274)
##########
experimental/traffic-portal/src/app/core/deliveryservice/new-delivery-service/new-delivery-service.component.ts:
##########
@@ -37,17 +37,17 @@
/**
* A regular expression that matches character strings that are illegal in `xml_id`s
*/
-const XML_ID_SANITIZE = /[^a-z0-9\-]+/g;
+const XML_ID_SANITIZE = /[^a-z0-9-]+/g;
/**
* A regular expression that matches a valid xml_id
*/
-const VALID_XML_ID = /^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$/;
+const VALID_XML_ID = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
/**
* A regular expression that matches a valid hostname
*/
-const VALID_HOSTNAME = /^[A-z\d]([A-z0-9\-]*[A-z0-9])?(\.[A-z\d]([A-z0-9\-]*[A-z0-9])?)*$/;
+const VALID_HOSTNAME = /^[A-z\d]([A-z0-9-]*[A-z0-9])?(\.[A-z\d]([A-z0-9-]*[A-z0-9])?)*$/;
Review Comment:
## Overly permissive regular expression range
Suspicious character range that is equivalent to \[A-Z\\[\\\\]^_`a-z\].
[Show more details](https://github.com/apache/trafficcontrol/security/code-scanning/270)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #7562: TPv2 Upgrade Angular to 16
Posted by "ocket8888 (via GitHub)" <gi...@apache.org>.
ocket8888 commented on code in PR #7562:
URL: https://github.com/apache/trafficcontrol/pull/7562#discussion_r1224643838
##########
experimental/traffic-portal/package.json:
##########
@@ -116,4 +116,4 @@
"optionalDependencies": {
"@compodoc/compodoc": "^1.1.18"
}
-}
+}
Review Comment:
missing newline at eof - did ng-cli do that? I don't think it used to do that
##########
experimental/traffic-portal/src/app/core/statuses/status-details/status-details.component.ts:
##########
@@ -20,7 +20,10 @@ import { ActivatedRoute } from "@angular/router";
import { RequestStatus, ResponseStatus } from "trafficops-types";
import { ServerService } from "src/app/api";
-import { DecisionDialogComponent, DecisionDialogData } from "src/app/shared/dialogs/decision-dialog/decision-dialog.component";
+import {
+ DecisionDialogComponent,
+ DecisionDialogData
+} from "src/app/shared/dialogs/decision-dialog/decision-dialog.component";
Review Comment:
did the upgrade make this change as a migration?
##########
experimental/traffic-portal/src/app/api/server.service.ts:
##########
@@ -198,7 +198,7 @@ export class ServerService extends APIService {
* docs.
*/
public async queueUpdates(server: number | ResponseServer): Promise<ServerQueueResponse> {
- const id = typeof(server) === "number" ? server : server.id;
+ const id = typeof (server) === "number" ? server : server.id;
Review Comment:
did the upgrade make this change as a migration?
##########
experimental/traffic-portal/src/app/core/cache-groups/asns/table/asns-table.component.ts:
##########
@@ -122,7 +122,7 @@ export class AsnsTableComponent implements OnInit {
}
const data = evt.data;
switch(evt.action) {
- case "delete":
+ case "delete": {
Review Comment:
did the upgrade make this change as a migration?
##########
experimental/traffic-portal/src/app/guards/authenticated-guard.service.ts:
##########
@@ -12,15 +12,14 @@
* limitations under the License.
*/
import { Injectable } from "@angular/core";
-import type { CanActivate, CanLoad } from "@angular/router";
import { CurrentUserService } from "src/app/shared/current-user/current-user.service";
/**
* AuthenticationGuard ensures that the user is logged in.
*/
@Injectable()
-export class AuthenticatedGuard implements CanActivate, CanLoad {
+export class AuthenticatedGuard {
Review Comment:
did the upgrade make this change as a migration?
##########
experimental/traffic-portal/src/app/utils/index.spec.ts:
##########
@@ -99,7 +99,7 @@ describe("Typing utility functions", () => {
it("should check homogenous array types correctly", () => {
const a = {};
expect(isArray(a)).toBeFalse();
- const b = new Array();
+ const b: unknown[] = [];
Review Comment:
did the upgrade make this change as a migration?
##########
experimental/traffic-portal/src/app/utils/order-by.ts:
##########
@@ -71,7 +71,7 @@ function cmpr(a: unknown, b: unknown): number {
* @param property Either a single property name or an array of property names to sort by - in descending order of importance.
* @returns The sorted array
*/
-export function orderBy<T extends any>(value: Array<T>, property: string | Array<string>): Array<T> {
+export function orderBy<T>(value: Array<T>, property: string | Array<string>): Array<T> {
Review Comment:
did the upgrade make this change as a migration?
##########
experimental/traffic-portal/.eslintrc.json:
##########
@@ -37,10 +37,16 @@
"createDefaultProgram": true
},
"extends": [
- "plugin:@angular-eslint/ng-cli-compat",
- "plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
+ "eslint:recommended",
+ "plugin:@typescript-eslint/recommended",
+ "plugin:@angular-eslint/recommended",
Review Comment:
This looks like it's adding at least `eslint:recommended`, not sure if the other two are just new names for the ng-cli-compat sets. But adding new linter rules seems out-of-scope for this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org