8000 Add upload-topics command to topicgenerator by kathy-t · Pull Request #489 · dockstore/dockstore-support · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add upload-topics command to topicgenerator #489

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 7 commits into from
Mar 28, 2024

Conversation

kathy-t
Copy link
Contributor
@kathy-t kathy-t commented Mar 21, 2024

Description
Related PR: dockstore/dockstore#5847

This PR adds an upload-topics command to the topic generator so it can upload the topics generated by the generate-topics command to Dockstore.

Review Instructions
Run the upload-topics command against QA to upload the generated topics in this file https://github.com/dockstore/dockstore-support/blob/develop/topicgenerator/results/generated-topics_GPT_3_5_TURBO_16K_20231113T135602Z.csv. Steps below:

  • Can create a new directory called topic-generator locally to do this testing

  • Create a topic-generator.config file. See the topicgenerator README for instructions on how to get set up. Note that you do not need the openai-api-key to run the upload-topics command.

  • Download the topicgenerator 1.16.0-alpha.1 JAR using

    wget https://artifacts.oicr.on.ca/artifactory/collab-release/io/dockstore/topicgenerator/1.16.0-alpha.1/topicgenerator-1.16.0-alpha.1.jar
    
  • Download the generated topics file

    wget https://raw.githubusercontent.com/dockstore/dockstore-support/develop/topicgenerator/results/generated-topics_GPT_3_5_TURBO_16K_20231113T135602Z.csv
    
  • Upload the topics

    java -jar topicgenerator-1.16.0-alpha.1.jar --config ./topic-generator.config upload-topics --aiTopics ./generated-topics_GPT_3_5_TURBO_16K_20231113T135602Z.csv
    
  • Go to the search page on QA and select the Workflows tab.

  • Verify that the first few workflows have topics with an AI bubble.

  • View this tool (should have permission to view it if you're a part of the dockstore GitHub organization, if not, run the Discover Existing Workflows button) https://qa.dockstore.org/my-tools/github.com/dockstore/dockstore-tool-bamstats/bamstats_sort_cwl and verify that the AI generated topic shows up.

  • Verify that the Topic Selection is not AI because the entry has an automatic topic.

  • Select AI Generated as the Topic Selection.

  • View the tool's public page and verify that the AI topic shows up. There should be an AI bubble.

  • Find the tool in the search table and verify that the AI topic shows up and that there's an AI bubble.

Issue
SEAB-6007

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.

@kathy-t kathy-t self-assigned this Mar 21, 2024
Copy link
codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 76.08696% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 54.44%. Comparing base (c751c2e) to head (1709ae0).

Files Patch % Lines
...opicgenerator/client/cli/TopicGeneratorClient.java 72.97% 8 Missing and 2 partials ⚠️
...e/metricsaggregator/MetricsAggregatorS3Client.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #489      +/-   ##
=============================================
- Coverage      56.02%   54.44%   -1.59%     
- Complexity       297      307      +10     
=============================================
  Files             33       37       +4     
  Lines           2001     2173     +172     
  Branches         163      177      +14     
=============================================
+ Hits            1121     1183      +62     
- Misses           796      903     +107     
- Partials          84       87       +3     
Flag Coverage Δ
metricsaggregator 44.40% <2.17%> (-3.82%) ⬇️
toolbackup 28.30% <2.17%> (-2.44%) ⬇️
tooltester 21.12% <2.17%> (-1.82%) ⬇️
topicgenerator 23.97% <76.08%> (?)

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.

pom.xml Outdated
@@ -38,7 +38,7 @@

<github.url>scm:git:git@github.com:dockstore/dockstore-support.git</github.url>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<dockstore-core.version>1.16.0-alpha.2</dockstore-core.version>
<dockstore-core.version>1.16.0-SNAPSHOT</dockstore-core.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update to tag when webservice PR is merged

@kathy-t kathy-t marked this pull request as ready for review March 21, 2024 21:02
Copy link
Member
@denis-yuen denis-yuen left a comment

Choose a reason for hiding this comment

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

Minor feedback

# networks:
# - elastic
postgres_db:
image: postgres:16.1
Copy link
Member

Choose a reason for hiding this comment

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

We're going to have a bunch of these scattered around, maybe a follow-up ticket to create a shared resource in https://github.com/dockstore/.github

This one in particular looks a lot like https://github.com/dockstore/dockstore-cli/blob/develop/docker-compose.yml with the right postgres version

Copy link
Member

Choose a reason for hiding this comment

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

One idea, could download during build via https://github.com/maven-download-plugin/maven-download-plugin

Copy link
Contributor Author

Choose a reason for hiding this comment

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


try (CSVPrinter csvPrinter = new CSVPrinter(new FileWriter(outputFileName, StandardCharsets.UTF_8), CSVFormat.DEFAULT.builder().setHeader(OutputCsvHeaders.class).build())) {
for (CSVRecord entry: entriesCsvRecords) {
final String trsId = entry.get(InputCsvHeaders.trsId);
final String versionId = entry.get(InputCsvHeaders.version);
final String trsId = entry.get(GenerateTopicsCommand.InputCsvHeaders.trsId);
Copy link
@svonworl svonworl Mar 28, 2024

Choose a reason for hiding this comment

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

The lowercase enum value names confuse me every time. No need to change, but I needed to vent that. :) It would be great if the apache csv library calculated the column name as the toString() of the enum value, so the enum names themselves could be capitalized correctly (with a little extra work/code). Or maybe it does? If it did, you could do something like:

public enum CsvColumns {
    ID("id"),
    SOME_VALUE("someValue");

    private final String value;
    public CsvColumns(String value) {
        this.value = value;
    }
    public String toString() {
        return value;
    }
}

Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

@kathy-t kathy-t merged commit 1de5923 into develop Mar 28, 2024
@kathy-t kathy-t deleted the feature/seab-6007/upload-ai-topics branch March 28, 2024 14:23
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
0