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: delete graphs before deleting org #1326

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

thisisnithin
Copy link
Member

Motivation and Context

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

@thisisnithin thisisnithin enabled auto-merge (squash) October 31, 2024 10:02
auto-merge was automatically disabled October 31, 2024 10:24

Pull request was closed

@thisisnithin thisisnithin reopened this Oct 31, 2024
@thisisnithin thisisnithin marked this pull request as draft October 31, 2024 10:26
@thisisnithin thisisnithin changed the title fix: set schema version as null on delete fix: delete graphs before deleting org Nov 5, 2024
@thisisnithin thisisnithin force-pushed the nithin/eng-5878-fix-federated-graph-schema-version-relation branch from 8bbaa60 to 862d419 Compare November 5, 2024 15:37
@thisisnithin thisisnithin marked this pull request as ready for review November 6, 2024 01:28
limit: 0,
offset: 0,
});
const subgraphs = await subgraphRepo.list({
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really necessary? Can't we delete all targets of the org?

keycloakClient,
keycloakRealm: realm,
},
blobStorage,
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why is this service dependency not part of he UserRepository constructor?

} = getConfig();

const userId = process.env.USER_ID || '';

const bucketName = extractS3BucketName(s3Storage);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it really necessary to put all the logic in here? Why don't we issue a job to the queue and the controlplane picks it up? In that way, we also leverage all benefits that the queue provides retry, history etc...

return this.db.transaction(async (tx) => {
const oidcRepo = new OidcRepository(tx);
const fedGraphRepo = new FederatedGraphRepository(this.logger, tx, organizationId);
Copy link
Contributor

Choose a reason for hiding this comment

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

If we go this road of deleting everything manuel, we need very good tests. Could you outline what is delete by constraints and what not?

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