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

feat: ✨ ♻️ 🐛 Codefair v3.1.0 #95

Merged
merged 9 commits into from
Nov 5, 2024
Merged

feat: ✨ ♻️ 🐛 Codefair v3.1.0 #95

merged 9 commits into from
Nov 5, 2024

Conversation

slugb0t
Copy link
Member

@slugb0t slugb0t commented Nov 1, 2024

Summary by Sourcery

Introduce a new workflow to streamline GitHub release integration with Zenodo archiving, ensuring metadata is updated before releases. Add support for custom license titles and improve error handling and logging. Fix issues with metadata PR links and codemeta.json date updates. Enhance the UI with additional resources and improved layouts.

New Features:

  • Implement a new workflow to integrate GitHub release process with Zenodo archiving, ensuring metadata is updated before each release.
  • Add support for custom license titles, allowing users to specify a title for custom licenses.

Bug Fixes:

  • Fix issue with PR link not being replaced correctly in the Metadata section of the FAIR Compliance Dashboard Issue.
  • Stop updating the date for 'first released date' in the existing codemeta.json file.

Enhancements:

  • Improve error handling and logging for Zenodo publishing and license detection processes.
  • Enhance the user interface with additional links to external resources and improved button layouts.

Documentation:

  • Update documentation to reflect changes in the release and archival process, including new workflows and UI enhancements.

slugb0t and others added 2 commits October 17, 2024 10:52
* fix: 🐛 patch removing pull_request.closed bug on metadata pr merge

* fix: 🐛 don't update firstPublished in the codemeta file + better logs

* fix: 🐛 patch error on reading db entry when it doesn't exist

* chore: 🔊 better log on successful Zenodo publish

* style: 🎨 margins between text and icon

* feat: ✨ links to the list of tools used for codefair in /codefair

* refactor: ✨ ♻️ abstract the license validation fn

* doc: 🔖 update changelog

* feat: ✨ ♻️ abstraction to zenodo workflow

* wip: 🚧 abstracting zenodo workflow

* feat: ✨ add help link in the Zenodo release page

* refactor: ♻️ ✨ abstract out github release functions

* refactor: 🔊 ♻️ improve error tracing in metadata file

* chore: 🔨 remove todo

* refactor: ✨ ♻️ abstracted Zenodo workflow (bot)

* wip: 🚧 save custom license content when no assertion is provided

* ✨ feat: add support for custom licenses (#90)

* ✨ feat: add support for custom licenses

* 🐛 fix: reset citation license field

* 🐛 fix: update zenodo workflow for custom licenses

* fix: 🐛 license is valid with custom license

* feat: ✨ custom license template

* ✨ feat: update codemeta, license and cwl ui paths (#91)

* ✨ feat: update meta paths for consistency

* 🚚 fix: updatel icense request path

* ✨ feat: add support for custom license title (#92)

* refactor: ♻️ ✨ new patches for license, cwl, metadata UI's

* refactor: ✨ ♻️ apply migrations from UI to bot

* feat: ✨ request custom license title from user

* refactor: ♻️ hide message box when custom license title is blank

* refactor: ♻️ issue dashboard requests custom title

* feat: ✨ Saving custom title (#93)

* feat: ✨ save custom title option

* refactor: :recyle: reuse saveLicenseDraft for storing custom license title

* refactor: ♻️ join draft and save title buttons together

* refactor: ♻️ use naive-ui's properties for styling

* chore: 🔨 remove typo

* chore: 🔨 remove unused variables

* feat: ✨ toasts for custom title saved button

* refactor: ♻️ function rename

* feat: ✨ create Zenodo metadata fn handles custom licenses

* feat: ✨ custom license reference for archival workflow

* refactor: ♻️ stop creating identifiers for new db entries

* refactor: ♻️ 🐛 revert allowing custom licenses for zenodo

* refactor: ♻️ Custom License Support (#94)

* refactor: ♻️ ✨ custom title saved updates dashboard, disable create release btn when custom license

* refactor: ♻️ block progress of fair release if license is custom

* feat: ✨ listener for when custom license title is saved through UI

* feat: ✨ prevent fair release if not fair compliant

* refactor: ♻️ improve license validation and update template text for custom licenses

* refactor: ♻️ re-render issue from ui side

* refactor: ♻️ update to message explaining custom licenses

* db calls running in parallel

* fix: 🐛 prevent Zendo section from being seen when the license is custom

* fix: 🐛 trim license content before comparison

---------

Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com>
@slugb0t slugb0t requested a review from megasanjay November 1, 2024 19:32
Copy link

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!

Copy link

sourcery-ai bot commented Nov 1, 2024

Reviewer's Guide by Sourcery

This pull request implements significant changes to improve the handling of custom licenses, refactor API routes, and enhance error handling throughout the application. The changes focus on streamlining the license management workflow and improving the user experience when dealing with custom licenses.

Sequence diagram for Zenodo deposition process

sequenceDiagram
    actor User
    participant App
    participant Zenodo
    participant GitHub
    User->>App: Request Zenodo deposition
    App->>GitHub: Fetch metadata
    App->>Zenodo: Create or fetch deposition
    App->>GitHub: Update metadata with DOI
    App->>Zenodo: Upload assets
    App->>Zenodo: Publish deposition
    App->>GitHub: Update release status
    App->>User: Notify completion
Loading

Class diagram for updated license management

classDiagram
    class LicenseRequest {
        +String licenseId
        +String licenseContent
        +String customLicenseTitle
        +Date updatedAt
    }
    class LicenseManager {
        +validateLicense(licenseRequest, existingLicense)
        +applyLicenseTemplate(context, owner, repository, subjects)
    }
    LicenseRequest --> LicenseManager : uses
    note for LicenseRequest "Handles license data including custom titles"
    note for LicenseManager "Manages license validation and application"
Loading

File-Level Changes

Change Details Files
Implemented custom license support with title management
  • Added custom license title field to database schema
  • Created new API endpoint for managing custom license titles
  • Added UI components for custom license title input and validation
  • Updated license validation logic to handle custom licenses
bot/license/index.js
ui/pages/dashboard/[owner]/[repo]/edit/license.vue
bot/prisma/migrations/20241025215938_custom_license_title/migration.sql
ui/prisma/migrations/20241025215938_custom_license_title/migration.sql
Refactored API routes to use owner/repo path parameters
  • Migrated from identifier-based to owner/repo-based routing
  • Updated API endpoints to use new routing structure
  • Added redirect handlers for backward compatibility
  • Updated frontend components to use new API routes
ui/server/api/[owner]/[repo]/license/index.post.ts
ui/server/api/[owner]/[repo]/code-metadata/index.post.ts
ui/server/routes/add/license/[identifier].get.ts
ui/server/routes/add/code-metadata/[identifier].get.ts
Enhanced error handling and logging
  • Added try-catch blocks around critical operations
  • Improved error messages and error propagation
  • Added more detailed logging for debugging
  • Standardized error handling patterns across the application
bot/archival/index.js
bot/metadata/index.js
bot/utils/tools/index.js
Updated UI components and user experience
  • Added warnings for custom license limitations
  • Improved navigation and breadcrumb handling
  • Updated dashboard layout and component organization
  • Enhanced form validation and user feedback
ui/pages/dashboard/[owner]/[repo]/release/zenodo.vue
ui/pages/dashboard/[owner]/[repo]/index.vue
ui/pages/codefair.vue

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 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

Copy link

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!

Copy link

what-the-diff bot commented Nov 1, 2024

PR Summary

  • Introduced new version with enhancements and bug fixes. The update made to CHANGELOG.md signifies the launch of version 3.0.1, which introduced improvements in logging, error management, layout adjustments, and various bug fixes.
  • Updated citation and Codemeta details. Modifications in CITATION.cff and codemeta.json altered the way the Digital Object Identifier (DOI) is represented and updated the version to v.3.0.0. Also, comments were updated in index.js files of different modules to reflect the current usage status and verification requirements.
  • Modified web URLs. Web addresses in CWL index.js were updated to direct to a new user dashboard.
  • Improved license handling. System enhancements were made to validate license requests more effectively, catering for specific conditions like "no-license" and "NOASSERTION". As part of this, the function applyLicenseTemplate was also improved.
  • Added error handling for missing metadata. In instances where metadata files are missing, the system now throws errors which makes the reporting of issues more effective.
  • Database and rendering updates for custom licenses. A new migration script was introduced to add 'custom_license_title' to the LicenseRequest model in the database. The capacity of the renderer was extended to check if the license are custom when rendering issue data.
  • Application utility functions added. New utility functions were developed for fetching GitHub releases and downloading repositories as zip files.
  • Enhanced support for "Custom" licenses. Support for a custom license was added in the licenses.json file.
  • UI and UX enhancements. In codefair.vue, NuxtLinks were added for external resources in the Codefair description, improving readability. Furthermore, minor adjustments were made to UI components for a consistent style and interaction, like button states and alert messages.
  • Refactored and renamed some components. The code-metadata Vue component was renamed and refactored to support editing within a repository context using owner and repo parameters instead of identifier. Also, new logic was introduced for handling custom license titles in license.vue, including error handling for missing titles and new API endpoints to save custom titles.
  • Changed the API and route structure. API calls and routing paths were updated to reflect a new endpoint structure based on owner and repo parameters. This also included changes in validation, authorization, and database queries. New route handlers were also introduced for handling code metadata, CWL validation, and license requests.
  • Enhanced error management. Meaningful and robust error management was implemented, particularly around validating request body content.
  • Improved response data structure. Identifier details were removed from responses, leading to a cleaner response structure for the users.
  • Added last login timestamp for users. The file ui/server/routes/login/github/callback.get.ts was updated to record the last login timestamp during the user update operation.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @slugb0t - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 3 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

bot/archival/index.js Show resolved Hide resolved
bot/archival/index.js Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
bot/archival/index.js Show resolved Hide resolved
bot/index.js Show resolved Hide resolved
bot/index.js Show resolved Hide resolved
bot/index.js Show resolved Hide resolved
bot/index.js Show resolved Hide resolved
@slugb0t slugb0t merged commit 7a89f2d into main Nov 5, 2024
1 check passed
Copy link

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!

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.

1 participant