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

Redeliver release events #498

Merged
merged 9 commits into from
Aug 21, 2024
Merged

Redeliver release events #498

merged 9 commits into from
Aug 21, 2024

Conversation

coverbeck
Copy link
Contributor

@coverbeck coverbeck commented Aug 8, 2024

Description
Redeliver release events. Code already delivers push and installation events. Did a little refactoring to avoid code duplication.

Review Instructions

  1. Create a GitHub Release for a repo you have configured on Dockstore QA.
  2. Ensure that you can see the event in app logs; copy the delivery id
  3. In CloudShell, install Java, clone dockstore-support, build ./mvnw install -pl githubdelivery -am
  4. Follow instructions in README.md to redeliver event.

Issue
SEAB-6466

Security
If there are any concerns that require extra attention from the security team, highlight them here.

Please make sure that you've checked the following before submitting your pull request. Thanks!

  • Check that you pass the basic style checks and unit tests by running mvn clean install in the project that you have modified (until https://ucsc-cgl.atlassian.net/browse/SEAB-5300 adds multi-module support properly)
  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.
  • If you are changing dependencies, check with dependabot to ensure you are not introducing new high/critical vulnerabilities
  • If this PR is for a user-facing feature, create and link a documentation ticket for this feature (usually in the same milestone as the linked issue). Style points if you create a documentation PR directly and link that instead.

@coverbeck coverbeck self-assigned this Aug 8, 2024
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.40%. Comparing base (68da2aa) to head (5b06e61).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #498      +/-   ##
=============================================
+ Coverage      39.62%   45.40%   +5.77%     
- Complexity       275      315      +40     
=============================================
  Files             50       50              
  Lines           2700     2700              
  Branches         209      209              
=============================================
+ Hits            1070     1226     +156     
+ Misses          1544     1381     -163     
- Partials          86       93       +7     
Flag Coverage Δ
metricsaggregator 36.40% <ø> (ø)
toolbackup 22.85% <ø> (?)
tooltester 17.07% <ø> (ø)
topicgenerator 20.29% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -124,29 +124,7 @@ private String getObject(String key) throws IOException {
ResponseInputStream<GetObjectResponse> object = s3Client.getObject(objectRequest);
return IOUtils.toString(object, StandardCharsets.UTF_8);
}
private PushPayload getGitHubPushPayloadByKey(String eventType, String body, String key) throws IOException, NoSuchKeyException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this to GitHubDeliveryHelper so I could eliminate some duplication and add a (crude) unit test.

assertEquals("1.0.0", payload.getRelease().getTagName());
}

private String readResourceAsString(String resource) throws IOException {

Choose a reason for hiding this comment

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

We might have an equivalent existing method in common.FixtureUtils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might have an equivalent existing method in common.FixtureUtils

We do, and I tried to use it, but because it's a test class, it's not bundled into commons artifacts that we depend on.

Choose a reason for hiding this comment

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

We might have an equivalent existing method in common.FixtureUtils

We do, and I tried to use it, but because it's a test class, it's not bundled into commons artifacts that we depend on.

Doh, thanks for trying!


private static final Logger LOG = LoggerFactory.getLogger(GithubDeliveryHelper.class);

private static final ObjectMapper MAPPER = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Copy link
Member

Choose a reason for hiding this comment

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

Seems like a common mapper configuration but I'm not sure how much (if any) dockstore common code we have access to here, so 🤷

Copy link

sonarcloud bot commented Aug 20, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@coverbeck coverbeck merged commit a4fa805 into develop Aug 21, 2024
10 of 11 checks passed
@coverbeck coverbeck deleted the feature/seab-6466/release branch August 21, 2024 16:26
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