fairdataihub / codefair-app

Your coding assistant to make research software reusable without breaking a sweat!
https://codefair.io
MIT License
7 stars 2 forks source link

refactor: ♻️ updates to zenodo workflow #84

Closed slugb0t closed 1 month ago

slugb0t commented 1 month ago

Summary by Sourcery

Refactor the Zenodo workflow to streamline metadata handling and improve error management, while enhancing the UI for better user feedback and guidance.

Enhancements:

fairdataihub-bot[bot] commented 1 month ago

Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again!

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request refactors the Zenodo workflow, improving the handling of metadata, error management, and user interface for the code metadata and release processes. The changes aim to enhance the robustness and user experience of the software archiving and release workflow.

Sequence diagram for Zenodo publish process

sequenceDiagram
    participant User
    participant UI as User Interface
    participant Server
    participant Zenodo

    User->>UI: Initiate Zenodo publish
    UI->>Server: Send publish request
    Server->>Zenodo: Publish deposition
    alt Success
        Zenodo-->>Server: Publish success
        Server-->>UI: Update status to 'published'
        UI-->>User: Notify success
    else Error
        Zenodo-->>Server: Publish error
        Server-->>UI: Update status to 'error'
        UI-->>User: Notify error
    end

User journey diagram for Zenodo release process

journey
    title Zenodo Release Process
    section Prepare Metadata
      User: 5: Review codemeta.json
      User: 4: Ensure metadata is up-to-date
    section Initiate Release
      User: 5: Start Zenodo publish
      System: 4: Validate metadata
    section Publish to Zenodo
      System: 3: Send data to Zenodo
      Zenodo: 3: Process deposition
    section Post-Publish
      System: 4: Update UI with status
      User: 5: Review Zenodo deposition
      User: 4: Add additional metadata if needed

Updated class diagram for metadata handling

classDiagram
    class Author {
        +String affiliation
        +String email
        +String familyName
        +String givenName
        +List~Role~ roles
        +String uri
    }
    class Role {
        +String role
        +Date startDate
        +Date endDate
    }
    class Contributor {
        +String affiliation
        +String email
        +String familyName
        +String givenName
        +List~Role~ roles
        +String uri
    }
    Author --> Role
    Contributor --> Role

File-Level Changes

Change Details Files
Refactored metadata handling for authors and contributors
  • Improved handling of author and contributor roles
  • Separated Person/Organization entries from Role entries
  • Enhanced mapping of metadata to Zenodo format
bot/metadata/index.js
Enhanced error handling and API interactions
  • Improved error catching and reporting in Zenodo API interactions
  • Added more detailed error messages
  • Refactored API calls to use Authorization header instead of query parameters
bot/archival/index.js
bot/index.js
Updated user interface for code metadata and release process
  • Improved form validation for code metadata
  • Enhanced UI feedback for invalid inputs
  • Updated Zenodo publish progress modal
ui/pages/dashboard/[owner]/[repo]/release/zenodo.vue
ui/pages/add/code-metadata/[identifier].vue
Improved license handling
  • Enhanced license detection and application
  • Updated license template application process
bot/license/index.js
ui/server/api/codeMetadata/[identifier]/index.post.ts
ui/server/api/codeMetadata/[identifier]/index.put.ts
Refactored issue rendering and pull request handling
  • Improved verification of open pull requests
  • Enhanced issue template rendering
  • Updated database entries for closed pull requests
bot/utils/renderer/index.js

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
fairdataihub-bot[bot] commented 1 month ago

Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions!

fairdataihub-bot[bot] commented 1 month ago

Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help!