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

Fixed missing changelog entries for v5 routes #7890

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7814](https://github.com/apache/trafficcontrol/issues/7814) All Go components: Updated the module path to [`github.com/apache/trafficcontrol/v8`](https://pkg.go.dev/github.com/apache/trafficcontrol/v8). Module https://pkg.go.dev/github.com/apache/trafficcontrol will not receive further updates.

### Fixed
- [#7885](https://github.com/apache/trafficcontrol/pull/7885) *Traffic Portal* Fixed the issue where Compare Profiles page was not being displayed.
- [#7890](https://github.com/apache/trafficcontrol/pull/7890) *Traffic Ops*: Fixed missing changelog entries to v5 routes.
- [#7885](https://github.com/apache/trafficcontrol/pull/7885) *Traffic Portal*: Fixed the issue where Compare Profiles page was not being displayed.
- [#7879](https://github.com/apache/trafficcontrol/7879) *Traffic Ops, Traffic Portal*: Fixed broken capability links for delivery service and added required capability as a column in DS table.
- [#7878](https://github.com/apache/trafficcontrol/pull/7878) *Traffic Ops, Traffic Portal*: Fixed the case where TO was failing to assign delivery services to a server, due to a bug in the way the list of preexisting delivery services was being returned.
- [#7819](https://github.com/apache/trafficcontrol/pull/7819) *Traffic Ops*: API v5 routes should not use `privLevel` comparisons.
Expand Down
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/asn/asns.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "asn was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/asns?id=%d", inf.Version, asn.ID))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, asn)
changeLogMsg := fmt.Sprintf("ASN: %d, ID:%d, ACTION: Created asn", asn.ASN, asn.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 317 in traffic_ops/traffic_ops_golang/asn/asns.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/asn/asns.go#L316-L317

Added lines #L316 - L317 were not covered by tests
return
}

Expand Down Expand Up @@ -372,6 +374,8 @@

alerts := tc.CreateAlerts(tc.SuccessLevel, "asn was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, asn)
changeLogMsg := fmt.Sprintf("ASN: %d, ID:%d, ACTION: Updated asn", asn.ASN, asn.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 378 in traffic_ops/traffic_ops_golang/asn/asns.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/asn/asns.go#L377-L378

Added lines #L377 - L378 were not covered by tests
return
}

Expand Down Expand Up @@ -417,6 +421,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "asn was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID: %s, ACTION: Deleted asn", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 425 in traffic_ops/traffic_ops_golang/asn/asns.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/asn/asns.go#L424-L425

Added lines #L424 - L425 were not covered by tests
return
}

Expand Down
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "cache group was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/cachegroups?name=%s", inf.Version, *cg.Name))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, cg)
changeLogMsg := fmt.Sprintf("CACHEGROUP: %s, ID:%d, ACTION: Created cachegroup", *cg.Name, *cg.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 1197 in traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go#L1196-L1197

Added lines #L1196 - L1197 were not covered by tests
return
}

Expand Down Expand Up @@ -1334,6 +1336,8 @@

alerts := tc.CreateAlerts(tc.SuccessLevel, "cache group was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, cg)
changeLogMsg := fmt.Sprintf("CACHEGROUP: %s, ID:%d, ACTION: Updated cachegroup", *cg.Name, *cg.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 1340 in traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go#L1339-L1340

Added lines #L1339 - L1340 were not covered by tests
return
}

Expand Down Expand Up @@ -1407,6 +1411,8 @@

alerts := tc.CreateAlerts(tc.SuccessLevel, "cache group was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID:%d, ACTION: Deleted cachegroup", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 1415 in traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go#L1414-L1415

Added lines #L1414 - L1415 were not covered by tests
return
}

Expand Down
9 changes: 8 additions & 1 deletion traffic_ops/traffic_ops_golang/cdn/cdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@
api.HandleErr(w, r, tx, code, usrErr, sysErr)
return
}
if rows.Next() {
defer rows.Close()
for rows.Next() {

Check warning on line 155 in traffic_ops/traffic_ops_golang/cdn/cdns.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cdn/cdns.go#L154-L155

Added lines #L154 - L155 were not covered by tests
if err = rows.Scan(&cdn.ID, &cdn.LastUpdated); err != nil {
usrErr, sysErr, code := api.ParseDBError(err)
api.HandleErr(w, r, tx, code, usrErr, sysErr)
Expand All @@ -162,6 +163,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "cdn was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/cdns?name=%s", inf.Version, cdn.Name))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, cdn)
changeLogMsg := fmt.Sprintf("CDN: %s, ID:%d, ACTION: Created cdn", cdn.Name, cdn.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 167 in traffic_ops/traffic_ops_golang/cdn/cdns.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cdn/cdns.go#L166-L167

Added lines #L166 - L167 were not covered by tests
return
}

Expand Down Expand Up @@ -221,6 +224,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "cdn was updated.")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, cdn)
changeLogMsg := fmt.Sprintf("CDN: %s, ID:%d, ACTION: Updated cdn", cdn.Name, cdn.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 228 in traffic_ops/traffic_ops_golang/cdn/cdns.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cdn/cdns.go#L227-L228

Added lines #L227 - L228 were not covered by tests
return
}

Expand Down Expand Up @@ -271,6 +276,8 @@
}

api.WriteAlerts(w, r, http.StatusOK, tc.CreateAlerts(tc.SuccessLevel, "cdn was deleted."))
changeLogMsg := fmt.Sprintf("ID:%d, ACTION: Deleted cdn", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 280 in traffic_ops/traffic_ops_golang/cdn/cdns.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cdn/cdns.go#L279-L280

Added lines #L279 - L280 were not covered by tests
return
}
func validateRequest(r *http.Request, v *api.Version) (tc.CDNV5, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,8 @@
userErr, sysErr, code := api.ParseDBError(err)
return code, userErr, fmt.Errorf("inserting a CDN Federation: %w", sysErr)
}

changeLogMsg := fmt.Sprintf("CDNFEDERATION: %s, ID:%d, ACTION: Created cdnFederation", fed.CName, fed.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, inf.Tx.Tx)
return inf.WriteCreatedResponse(fed, "Federation was created", "federations/"+strconv.Itoa(fed.ID))
}

Expand Down Expand Up @@ -671,6 +672,8 @@
return code, userErr, sysErr
}

changeLogMsg := fmt.Sprintf("CDNFEDERATION: %s, ID:%d, ACTION: Updated cdnFederation", fed.CName, id)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, inf.Tx.Tx)

Check warning on line 676 in traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go#L675-L676

Added lines #L675 - L676 were not covered by tests
return inf.WriteSuccessResponse(fed, "Federation was updated")
}

Expand All @@ -684,6 +687,7 @@
userErr, sysErr, code := api.ParseDBError(err)
return code, userErr, sysErr
}

changeLogMsg := fmt.Sprintf("CDNFEDERATION:%s, ID:%d, ACTION: Deleted cdnFederation", fed.CName, fed.ID)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, inf.Tx.Tx)

Check warning on line 691 in traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go#L690-L691

Added lines #L690 - L691 were not covered by tests
return inf.WriteSuccessResponse(fed, "Federation was deleted")
}
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/division/divisions.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "division was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/divisons?name=%s", inf.Version, div.Name))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, div)
changeLogMsg := fmt.Sprintf("DIVISION: %s, ID:%d, ACTION: Created division", div.Name, div.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 252 in traffic_ops/traffic_ops_golang/division/divisions.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/division/divisions.go#L251-L252

Added lines #L251 - L252 were not covered by tests
return
}

Expand Down Expand Up @@ -297,6 +299,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "division was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, div)
changeLogMsg := fmt.Sprintf("DIVISION: %s, ID:%d, ACTION: Updated division", div.Name, div.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 303 in traffic_ops/traffic_ops_golang/division/divisions.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/division/divisions.go#L302-L303

Added lines #L302 - L303 were not covered by tests
return
}

Expand Down Expand Up @@ -350,6 +354,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "division was deleted.")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, inf.Params)
changeLogMsg := fmt.Sprintf("ID:%s, ACTION: Deleted division", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 358 in traffic_ops/traffic_ops_golang/division/divisions.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/division/divisions.go#L357-L358

Added lines #L357 - L358 were not covered by tests
return
}

Expand Down
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/origin/origins.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "origin was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/origins?id=%d", inf.Version, org.ID))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, org)
changeLogMsg := fmt.Sprintf("ORIGIN: %s, ID:%d, ACTION: Created origin", org.Name, org.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx.Tx)

Check warning on line 582 in traffic_ops/traffic_ops_golang/origin/origins.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/origin/origins.go#L581-L582

Added lines #L581 - L582 were not covered by tests
}

// Update a Origin for APIv5.
Expand Down Expand Up @@ -670,6 +672,8 @@
origin.ID = requestedOriginId
alerts := tc.CreateAlerts(tc.SuccessLevel, "origin was updated.")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, origin)
changeLogMsg := fmt.Sprintf("ORIGIN: %s, ID:%d, ACTION: Updated origin", origin.Name, origin.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx.Tx)

Check warning on line 676 in traffic_ops/traffic_ops_golang/origin/origins.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/origin/origins.go#L675-L676

Added lines #L675 - L676 were not covered by tests
return
}

Expand Down Expand Up @@ -741,6 +745,8 @@

alerts := tc.CreateAlerts(tc.SuccessLevel, "origin was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID:%d, ACTION: Deleted origin", origin.ID)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 749 in traffic_ops/traffic_ops_golang/origin/origins.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/origin/origins.go#L748-L749

Added lines #L748 - L749 were not covered by tests
return
}

Expand Down
8 changes: 8 additions & 0 deletions traffic_ops/traffic_ops_golang/parameter/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "All Requested Parameters were created.")
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, objParam)
for _, param := range params {
changeLogMsg := fmt.Sprintf("PARAMETER: %s, ID:%d, ACTION: Created parameter", param.Name, param.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)
}

Check warning on line 430 in traffic_ops/traffic_ops_golang/parameter/parameters.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/parameter/parameters.go#L427-L430

Added lines #L427 - L430 were not covered by tests
return
}

Expand Down Expand Up @@ -489,6 +493,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "parameter was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, parameter)
changeLogMsg := fmt.Sprintf("PARAMETER: %s, ID:%d, ACTION: Updated parameter", parameter.Name, parameter.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 497 in traffic_ops/traffic_ops_golang/parameter/parameters.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/parameter/parameters.go#L496-L497

Added lines #L496 - L497 were not covered by tests
return
}

Expand Down Expand Up @@ -533,6 +539,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "parameter"+
" was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID:%s, ACTION: Deleted parameter", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 543 in traffic_ops/traffic_ops_golang/parameter/parameters.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/parameter/parameters.go#L542-L543

Added lines #L542 - L543 were not covered by tests
return
}

Expand Down
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/physlocation/phys_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "physLocation was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/phys_locations?name=%s", inf.Version, physLocation.Name))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, physLocation)
changeLogMsg := fmt.Sprintf("PHYSLOCATION: %s, ID:%d, ACTION: Created physLocation", physLocation.Name, physLocation.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 377 in traffic_ops/traffic_ops_golang/physlocation/phys_locations.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/physlocation/phys_locations.go#L376-L377

Added lines #L376 - L377 were not covered by tests
return
}

Expand Down Expand Up @@ -454,6 +456,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "physLocation was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, physLocation)
changeLogMsg := fmt.Sprintf("PHYSLOCATION: %s, ID:%d, ACTION: Updated physLocation", physLocation.Name, physLocation.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 460 in traffic_ops/traffic_ops_golang/physlocation/phys_locations.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/physlocation/phys_locations.go#L459-L460

Added lines #L459 - L460 were not covered by tests
return
}

Expand Down Expand Up @@ -506,6 +510,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "phys_location was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID:%s, ACTION: Deleted physLocation", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 514 in traffic_ops/traffic_ops_golang/physlocation/phys_locations.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/physlocation/phys_locations.go#L513-L514

Added lines #L513 - L514 were not covered by tests
return
}

Expand Down
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/profile/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "profile was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/profiles?id=%d", inf.Version, profile.ID))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, profile)
changeLogMsg := fmt.Sprintf("PROFILE: %s, ID:%d, ACTION: Created profile", profile.Name, profile.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 515 in traffic_ops/traffic_ops_golang/profile/profiles.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/profile/profiles.go#L514-L515

Added lines #L514 - L515 were not covered by tests
return
}

Expand Down Expand Up @@ -572,6 +574,8 @@

alerts := tc.CreateAlerts(tc.SuccessLevel, "profile was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, profile)
changeLogMsg := fmt.Sprintf("PROFILE: %s, ID:%d, ACTION: Updated profile", profile.Name, profile.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 578 in traffic_ops/traffic_ops_golang/profile/profiles.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/profile/profiles.go#L577-L578

Added lines #L577 - L578 were not covered by tests
return
}

Expand Down Expand Up @@ -633,6 +637,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "profile was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID:%d, ACTION: Deleted profile", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 641 in traffic_ops/traffic_ops_golang/profile/profiles.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/profile/profiles.go#L640-L641

Added lines #L640 - L641 were not covered by tests
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "All Requested ProfileParameters were created.")
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, objProfileParams)
for _, profileParam := range profileParams {
changeLogMsg := fmt.Sprintf("PROFILEPARAMETER Profile ID: %d, ParameterID:%d, ACTION: Created profileParameter", profileParam.ProfileID, profileParam.ParameterID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)
}

Check warning on line 417 in traffic_ops/traffic_ops_golang/profileparameter/profile_parameters.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/profileparameter/profile_parameters.go#L414-L417

Added lines #L414 - L417 were not covered by tests
return

}
Expand Down Expand Up @@ -471,6 +475,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "profile_parameter"+
" was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("PROFILEPARAMETER Profile ID: %s, ParameterID:%s, ACTION: Deleted profileParameter", profileID, parameterID)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 479 in traffic_ops/traffic_ops_golang/profileparameter/profile_parameters.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/profileparameter/profile_parameters.go#L478-L479

Added lines #L478 - L479 were not covered by tests
return
}

Expand Down
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/region/regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "region is created.")
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, rg)
changeLogMsg := fmt.Sprintf("REGION: %s, ID:%d, ACTION: Created region", rg.Name, rg.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 309 in traffic_ops/traffic_ops_golang/region/regions.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/region/regions.go#L308-L309

Added lines #L308 - L309 were not covered by tests
return
}

Expand Down Expand Up @@ -350,6 +352,8 @@

alerts := tc.CreateAlerts(tc.SuccessLevel, "region was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, rg)
changeLogMsg := fmt.Sprintf("REGION: %s, ID:%d, ACTION: Updated region", rg.Name, rg.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 356 in traffic_ops/traffic_ops_golang/region/regions.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/region/regions.go#L355-L356

Added lines #L355 - L356 were not covered by tests
return
}

Expand Down Expand Up @@ -425,6 +429,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "region was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID:%s, ACTION: Deleted region", requestedRegionId)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 433 in traffic_ops/traffic_ops_golang/region/regions.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/region/regions.go#L432-L433

Added lines #L432 - L433 were not covered by tests
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "server capability was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, sc)
changeLogMsg := fmt.Sprintf("CAPABILITY NAME:%s, ACTION: Updated serverCapability", sc.Name)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 243 in traffic_ops/traffic_ops_golang/servercapability/servercapability.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/servercapability/servercapability.go#L242-L243

Added lines #L242 - L243 were not covered by tests
return
}

Expand Down Expand Up @@ -284,6 +286,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "server capability was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/server_capabilities?name=%s", inf.Version, sc.Name))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, sc)
changeLogMsg := fmt.Sprintf("CAPABILITY NAME:%s, ACTION: Created serverCapability", sc.Name)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 290 in traffic_ops/traffic_ops_golang/servercapability/servercapability.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/servercapability/servercapability.go#L289-L290

Added lines #L289 - L290 were not covered by tests
return
}

Expand Down Expand Up @@ -337,6 +341,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "server capability was deleted.")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, name)
changeLogMsg := fmt.Sprintf("CAPABILITY NAME:%s, ACTION: Deleted serverCapability", name)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 345 in traffic_ops/traffic_ops_golang/servercapability/servercapability.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/servercapability/servercapability.go#L344-L345

Added lines #L344 - L345 were not covered by tests
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "service category was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/service_category?name=%s", inf.Version, sc.Name))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, sc)
changeLogMsg := fmt.Sprintf("SERVICECATEGORY: %s ACTION: Created serviceCategory", sc.Name)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 339 in traffic_ops/traffic_ops_golang/servicecategory/servicecategories.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/servicecategory/servicecategories.go#L338-L339

Added lines #L338 - L339 were not covered by tests
return
}

Expand Down Expand Up @@ -380,6 +382,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "service category was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, sc)
changeLogMsg := fmt.Sprintf("SERVICECATEGORY: %s, ACTION: Updated serviceCategory", sc.Name)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 386 in traffic_ops/traffic_ops_golang/servicecategory/servicecategories.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/servicecategory/servicecategories.go#L385-L386

Added lines #L385 - L386 were not covered by tests
return
}

Expand Down Expand Up @@ -432,6 +436,8 @@
alertMessage := fmt.Sprintf("%s was deleted.", name)
alerts := tc.CreateAlerts(tc.SuccessLevel, alertMessage)
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("SERVICECATEGORY: %s, ACTION: Deleted serviceCategory", name)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 440 in traffic_ops/traffic_ops_golang/servicecategory/servicecategories.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/servicecategory/servicecategories.go#L439-L440

Added lines #L439 - L440 were not covered by tests
return
}

Expand Down
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@
alerts := tc.CreateAlerts(tc.SuccessLevel, "type was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/type?name=%s", inf.Version, typ.Name))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, typ)
changeLogMsg := fmt.Sprintf("TYPE: %s, ID:%d, ACTION: Created type", typ.Name, typ.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)

Check warning on line 330 in traffic_ops/traffic_ops_golang/types/types.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/types/types.go#L329-L330

Added lines #L329 - L330 were not covered by tests
return
}

Expand Down Expand Up @@ -373,6 +375,8 @@
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "type was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, typ)
changeLogMsg := fmt.Sprintf("TYPE: %s, ID:%d, ACTION: Updated type", typ.Name, typ.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)

Check warning on line 379 in traffic_ops/traffic_ops_golang/types/types.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/types/types.go#L378-L379

Added lines #L378 - L379 were not covered by tests
return
}

Expand Down Expand Up @@ -418,6 +422,8 @@
alertMessage := fmt.Sprintf("type was deleted.")
alerts := tc.CreateAlerts(tc.SuccessLevel, alertMessage)
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID:%s, ACTION: Deleted type", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)

Check warning on line 426 in traffic_ops/traffic_ops_golang/types/types.go

View check run for this annotation

Codecov / codecov/patch

traffic_ops/traffic_ops_golang/types/types.go#L425-L426

Added lines #L425 - L426 were not covered by tests
return
}

Expand Down
Loading