Skip to content

feat: dependent resource context + my sql e2e test improvements #979

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

Merged
merged 3 commits into from
Mar 1, 2022

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented Feb 28, 2022

No description provided.

@csviri csviri self-assigned this Feb 28, 2022
@csviri csviri marked this pull request as ready for review February 28, 2022 15:16
@csviri
Copy link
Collaborator Author

csviri commented Feb 28, 2022

Added access to managed dependent resources, not sure if that is there the map in the context makes sense anymore. @metacosm

context.getMandatory(MYSQL_SECRET_USERNAME, String.class));
Secret secret = context.getSecondaryResource(Secret.class).orElseThrow();
SchemaDependentResource schemaDependentResource = context.managedDependentResourceContext()
.getDependentResource(SchemaDependentResource.class);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it'd be better to get the dependent via its class in a way similar to what we do for secondary resources, i.e. getDependentResource(Schema.class), though I guess this way this side-steps the issue of what to do when there are multiple dependents with the same type? Maybe provide both versions?

Copy link
Collaborator Author

@csviri csviri Feb 28, 2022

Choose a reason for hiding this comment

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

I think it'd be better to get the dependent via its class in a way similar to what we do for secondary resources, i.e. getDependentResource(Schema.class)

That is how it's done, just hidden behind dedicated context. Or?

though I guess this way this side-steps the issue of what to do when there are multiple dependents with the same type? Maybe provide both versions?

I intentionally did not cover this, since on denepnds_on we plan to have names of the resources, so I would add that as part of it?!

Copy link
Collaborator

@metacosm metacosm left a comment

Choose a reason for hiding this comment

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

Minor nit-pick, otherwise LGTM.

@csviri
Copy link
Collaborator Author

csviri commented Feb 28, 2022

Added access to managed dependent resources, not sure if that is there the map in the context makes sense anymore. @metacosm

What do you thin about this ? @metacosm

@csviri csviri linked an issue Feb 28, 2022 that may be closed by this pull request
@metacosm
Copy link
Collaborator

Added access to managed dependent resources, not sure if that is there the map in the context makes sense anymore. @metacosm

What do you thin about this ? @metacosm

We can remove it for now and re-add it if needed.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 38 Code Smells

34.9% 34.9% Coverage
0.3% 0.3% Duplication

@csviri
Copy link
Collaborator Author

csviri commented Mar 1, 2022

Added access to managed dependent resources, not sure if that is there the map in the context makes sense anymore. @metacosm

What do you thin about this ? @metacosm

We can remove it for now and re-add it if needed.

oki, will create a separate PR, others are fixed.

@csviri csviri merged commit a4582a3 into next Mar 1, 2022
@csviri csviri deleted the mysql-update branch March 1, 2022 07:34
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.

Accessing Other Dependent Resources for a Managed Dependent Resource
2 participants