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 ForceReconcile, add unit and e2e tests #1338

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

johannes94
Copy link
Contributor

@johannes94 johannes94 commented Oct 11, 2023

Description

This PR fixes a bug with strategic patch for the endpoint. PATCH /api/rhacs/v1/admin/central/$tenant_id. ForceReconcile in the database would never be set because it is deleted from the map used to merge the original requests values with the patch values.

Also adds an E2E test to make sure force_reconcile can always be set via API because it is required for a lot of SOPs to work properly.

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

only CI/local unit test

# 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

@johannes94 johannes94 temporarily deployed to development October 11, 2023 15:59 — with GitHub Actions Inactive
@johannes94 johannes94 temporarily deployed to development October 11, 2023 15:59 — with GitHub Actions Inactive
@johannes94 johannes94 temporarily deployed to development October 11, 2023 15:59 — with GitHub Actions Inactive
@johannes94 johannes94 changed the title add e2e and unit test for force reconcile fix ForceReconcile, add unit and e2e tests Oct 11, 2023
@johannes94 johannes94 temporarily deployed to development October 11, 2023 16:02 — with GitHub Actions Inactive
@johannes94 johannes94 temporarily deployed to development October 11, 2023 16:02 — with GitHub Actions Inactive
@johannes94 johannes94 temporarily deployed to development October 11, 2023 16:02 — with GitHub Actions Inactive
@johannes94 johannes94 temporarily deployed to development October 11, 2023 19:49 — with GitHub Actions Inactive
@johannes94 johannes94 temporarily deployed to development October 11, 2023 19:49 — with GitHub Actions Inactive
@johannes94 johannes94 temporarily deployed to development October 11, 2023 19:49 — with GitHub Actions Inactive
Copy link
Collaborator

@ludydoo ludydoo left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀
I find it confusing that the API has both camel and snake case json fields! (e.g. centralDataURL and instance_type).

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johannes94, ludydoo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@johannes94
Copy link
Contributor Author

/retest

@johannes94
Copy link
Contributor Author

johannes94 commented Oct 11, 2023

Looks good! 🚀 I find it confusing that the API has both camel and snake case json fields! (e.g. centralDataURL and instance_type).

Absolutely, but it is this way to stick to the naming convention of the fleet-manager template that introduced the inconsistency.

@johannes94 johannes94 merged commit 41fcbb4 into main Oct 12, 2023
8 checks passed
@johannes94 johannes94 deleted the jmalsam/fix-admin-force-reconcile branch October 12, 2023 06:57
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants