Skip to content

Conversation

@vladislav-sidorovich
Copy link
Member

@vladislav-sidorovich vladislav-sidorovich commented Mar 20, 2025

It's very simple forget to add '--assessment' flag to connector. The problem is that the mistake will be find only during uploading zip to server.

So, the idea is to explicitly mark each connector if assessment flag is required or not for the connector. In addition to that the test will verify that connectors are aligned with the annotations.

Please help to double check if the connectors marked properly by RespectsArgumentAssessment or AvoidArgumentAssessment.

It should be at least align with our public doc: https://cloud.google.com/bigquery/docs/migration-assessment#teradata_1

Note: the test is failed because the validation logic doesn't exist for all the connector. I would prefer first define the list of connectors and add the validation logic later.

ImmutableCollection<Connector> connectors = ConnectorRepository.getInstance().getAllConnectors();
for (Connector connector : connectors) {
RespectsArgumentAssessment assessment = AnnotationUtils.findAnnotation(connector.getClass(),
RespectsArgumentAssessment.class);
Copy link
Member

Choose a reason for hiding this comment

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

Many connectors don't have this annotation, despite using the --assessment flag and they will not be found by this test.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's true. We need an additional test to verify that developer explicitly chased to use or do not use the annotation.

@kpiotrowski
Copy link
Contributor

What about the connectors that are shared by assessment and translation? Depending on the use case they will need --assessment flag or not. This is true for most of the "metadata" connectors supported by the assessment. Additionally, some query logs connectors are shared by assessment and lineage.

@vladislav-sidorovich
Copy link
Member Author

What about the connectors that are shared by assessment and translation? Depending on the use case they will need --assessment flag or not. This is true for most of the "metadata" connectors supported by the assessment. Additionally, some query logs connectors are shared by assessment and lineage.

In this case such connectors should be able accept and process the flag. But I think we can go case by case.

@shevek-google what do you think?

@misolt
Copy link
Member

misolt commented Sep 16, 2025

Alternative solution:

  • Add an enum getter in Connector, e.g. getAssessmentSupport()
  • The enum represents the connector's --assesssment flag expectations, with the values REQUIRED, FORBIDDEN, OPTIONAL.
  • Implement a default in Connector to return FORBIDDEN.
  • Check and enforce it in shared dumper code

This has a few benefits:

  • Can be overridden as abstract in an abstract connector to force explicit handling by subclasses.
  • No changes to connectors that assessment doesn't use, except more strict validation.
  • It's easy to look up the connectors that allow the flag.
  • Optionally, ConnectorArguments can be changed to check if a connector asking about the assessment flag makes sense - for REQUIRED and FORBIDDEN it doesn't.

@github-actions
Copy link

This PR is stale because it has been open 35 days with no activity. Remove "stale" label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants