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

feat: central traits #1549

Closed
wants to merge 1,318 commits into from
Closed

feat: central traits #1549

wants to merge 1,318 commits into from

Conversation

parametalol
Copy link
Contributor

@parametalol parametalol commented Jan 2, 2024

Description

Added traits column to the central_requests table, which may hold an array of strings.

API:

  • show instance traits: GET /v1/admin/centrals/<id>/traits
  • check if an instance has a trait: GET /v1/admin/centrals/<id>/traits/<trait>
  • add a trait: PATCH /v1/admin/centrals/<id>/traits/<trait>
  • delete a trait: DELETE /v1/admin/centrals/<id>/traits/<trait>

Filtering instances by their traits will be implemented with the "class" API. Altering the search functionality may be too cumbersome at this point.

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
  • Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
  • Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.
  • Add secret to app-interface Vault or Secrets Manager if necessary
  • RDS changes were e2e tested manually
  • Check AWS limits are reasonable for changes provisioning new resources

Test manual

$ CENTRAL="http://localhost:8000/api/rhacs/v1/admin/centrals/cl75fu8bs0bd6k334h0g"
$ curl -H $AUTH "$CENTRAL/traits" 
$ curl -H $AUTH "$CENTRAL/traits/trait1" -X PATCH
$ curl -H $AUTH "$CENTRAL/traits"
["trait1"]
$ curl -H $AUTH "$CENTRAL/traits/trait1" --fail && echo OK
OK
$ curl -H $AUTH "$CENTRAL/traits/trait2" --fail && echo OK
curl: (22) The requested URL returned error: 404
$ curl -H $AUTH "$CENTRAL/traits/trait2" -X PATCH
$ curl -H $AUTH "$CENTRAL/traits"
["trait1","trait2"]
$ curl -H $AUTH "$CENTRAL/traits/trait1" -X PATCH
$ curl -H $AUTH "$CENTRAL/traits"
["trait1","trait2"]
$ curl -H $AUTH "$CENTRAL/traits" -X DELETE
$ curl -H $AUTH "$CENTRAL/traits"
["trait2"]
$ curl -H $AUTH "$CENTRAL" -s | jq '.traits'
[
  "trait2"
]
# To run tests locally run:
make db/teardown db/setup db/migrate
make ocm/setup OCM_OFFLINE_TOKEN=<ocm-offline-token> OCM_ENV=development
make verify lint binary test test/integration

dhaus67 and others added 30 commits September 15, 2023 17:30
ROX-19725: push observability stage branch to stage env
New workflow to auto-create production merge PRs.
* Bump controller-runtime and stackrox deps

* Bump openshift/api
Adding CODEOWNERS to semi-lock the Helm chart, ensuring smooth Addon transition.
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.11.0 to 0.12.0.
- [Commits](golang/oauth2@v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.4 to 1.45.15.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](aws/aws-sdk-go@v1.45.4...v1.45.15)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.11.0 to 2.12.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.11.0...v2.12.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.