-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add BSA validation job #2356
Add BSA validation job #2356
Conversation
return null; | ||
} | ||
|
||
void emailValidationResults(String job, ImmutableList<String> errors) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
return null; | ||
} | ||
|
||
void emailValidationResults(String job, ImmutableList<String> errors) { |
Check notice
Code scanning / CodeQL
Useless parameter Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 9 files reviewed, 2 unresolved discussions (waiting on @Github-advanced-security[bot])
core/src/main/java/google/registry/bsa/BsaValidateAction.java
line 93 at r1 (raw file):
Previously, github-advanced-security[bot] wrote…
Useless parameter
The parameter 'job' is never used.
Params will be used.
core/src/main/java/google/registry/bsa/BsaValidateAction.java
line 93 at r1 (raw file):
Previously, github-advanced-security[bot] wrote…
Useless parameter
The parameter 'errors' is never used.
Params will be used.
Please add any new Action to https://cs.opensource.google/nomulus/nomulus/+/master:core/src/main/java/google/registry/module/RequestComponent.java as well. |
1677498
to
6a6ac77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Reviewable status: 0 of 10 files reviewed, 2 unresolved discussions (waiting on @Github-advanced-security[bot])
We should add a test to make sure that there's no divergence going forward. Not in this PR, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 9 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 5 of 10 files reviewed, 5 unresolved discussions (waiting on @Github-advanced-security[bot], @jianglai, and @weiminyu)
core/src/main/java/google/registry/bsa/BsaValidateAction.java
line 99 at r2 (raw file):
ImmutableList<String> checkBsaLabels(String jobName) { ImmutableSet<String> downloadedLabels = fetchDownloadedLabels(jobName); ImmutableSet<String> persistedLabels = fetchPersistedLabels(/* batchSize= */ 500);
You should make the batch size configurable
core/src/main/java/google/registry/bsa/BsaValidateAction.java
line 118 at r2 (raw file):
String.format( "Found %d unexpected labels in the DB. Examples: [%s]", missingLabels.size(), examples);
This should use unexpectedLabels
core/src/main/java/google/registry/bsa/persistence/Queries.java
line 55 at r2 (raw file):
"SELECT b.label FROM BsaLabel b WHERE b.label > :lastRead ORDER BY b.label", String.class) .setParameter("lastRead", lastRead.orElse(""))
Does this work when lastRead is empty? Does "... WHERE b.label > ORDER BY b.label" work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 10 files reviewed, 5 unresolved discussions (waiting on @Github-advanced-security[bot], @jianglai, and @sarahcaseybot)
core/src/main/java/google/registry/bsa/BsaValidateAction.java
line 99 at r2 (raw file):
Previously, sarahcaseybot wrote…
You should make the batch size configurable
Done.
core/src/main/java/google/registry/bsa/BsaValidateAction.java
line 118 at r2 (raw file):
Previously, sarahcaseybot wrote…
This should use unexpectedLabels
Done.
core/src/main/java/google/registry/bsa/persistence/Queries.java
line 55 at r2 (raw file):
Previously, sarahcaseybot wrote…
Does this work when lastRead is empty? Does "... WHERE b.label > ORDER BY b.label" work?
When lastRead is empty the query will be WHERE b.label > '' ORDER BY b.label
.
Empty string goes before any other string.
One of the new method in QueriesTest.java
tests this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 9 files at r1, 2 of 2 files at r3, all commit messages.
Reviewable status: 9 of 10 files reviewed, 2 unresolved discussions (waiting on @Github-advanced-security[bot] and @jianglai)
cb1dd43
to
0a71d6b
Compare
Add the BsaValidateAction class with a first check (for inconsistency between downloaded and persisted labels).
0a71d6b
to
331234c
Compare
Add the BsaValidateAction class with a first check (for inconsistency between downloaded and persisted labels).
This change is