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

[IA-5017] Event pubsub google client code #19

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

Conversation

jdcanas
Copy link
Contributor

@jdcanas jdcanas commented Jul 10, 2024

No description provided.

@jdcanas jdcanas requested a review from a team as a code owner July 10, 2024 22:59
@@ -67,6 +70,8 @@ void testCreateChart_singleElement() {
assertEquals(chart1.name(), argument.getValue().name());
assertEquals(chart1.version(), argument.getValue().version());
assertNull(argument.getValue().activeAt());

verify(publisherDao, times(1)).publish("chart created");
Copy link
Contributor

Choose a reason for hiding this comment

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

I am thinking through the additional verifications on this test ... curious to have the brainstorm (maybe) here.

There is the validating that things are being created (chartDao) and that appropriate events are being fired. Maybe need to think through making this clearer? Meaning, does it make sense to break out the verifications into separate explicit methods such that they are clear on what we are validating? maybe something like #verifyChart and #verifyEvent

@cpate4 cpate4 requested a review from LizBaldo September 3, 2024 15:15
Copy link
Contributor

@LizBaldo LizBaldo left a comment

Choose a reason for hiding this comment

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

This is a pretty big PR, would you be able to add a description and link the relevant tickets?

implementation platform('com.google.cloud:libraries-bom:26.42.0')
implementation 'com.google.cloud:google-cloud-pubsub'

implementation platform('org.testcontainers:testcontainers-bom:1.20.1')
Copy link
Contributor

Choose a reason for hiding this comment

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

Needed for pubsub emulator and unit testing

}
return builder.build();
} catch (IOException | ConfigurationException e) {
throw new RuntimeException(e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Generic Java term that we unfortunately overloaded in leo 😓

ApplicationContext applicationContext,
BeeConfig beeConfig,
GoogleConfig googleConfig,
ObjectProvider<String> pubsubEmulatorEndpoint) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you leave a comment explaining what the pubsubEmulatorEndpoint does and how it gets injected here?

return process(msg);
} catch (JsonProcessingException e) {
logger.error("error while converting message data to EventMessage", e);
// TODO: what to do with bad messages
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be taken care of already by the dead letter queue

* This is the current version of the EventMessage schema, as defined in the spec (see class-level
* javadoc).
*/
public static String MESSAGE_VERSION = "1.0.0";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment linking the chage in terraform that needs to be done if the schema needs to be updated?

@@ -0,0 +1,7 @@
package bio.terra.common.events.topics.messages;

public enum EventTypes {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe leave a warning about preserving the order of this enum list as it can get messy quickly

Copy link
Contributor

Choose a reason for hiding this comment

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

Would a dict with a key/value pair bring more robustness?

@@ -2,6 +2,14 @@
# This is for deployment-specific values, which may be managed by other teams

env:
google:
project_id: ${SERVICE_GOOGLE_PROJECT:broad-dsde-dev}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also add pubsub emulator for dummies section in the contributing.md? ;)

public abstract class BaseEventsTest<T extends EventTopic<?>> extends BaseSpringBootTest {

@TestConfiguration
public static class MockEventConfiguration<T> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be MockChartEventConfiguration?

Copy link

sonarcloud bot commented Sep 12, 2024

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.

4 participants