-
Notifications
You must be signed in to change notification settings - Fork 56
Allow creation of new workflow version via RO-Crate upload (in UI) #2430
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
base: main
Are you sure you want to change the base?
Conversation
Previously there could be junk commits in the history from versions that were not saved
* Base off a fresh version to clear git annotations. * Use commit on current version if available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds UI functionality to create new workflow versions via RO-Crate upload, complementing the existing Git-based versioning system. The key change enables users to upload an RO-Crate ZIP file through a web form to create a new version of an existing workflow.
- Adds a new
create_version_from_ro_cratecontroller action and route for handling RO-Crate-based version creation through the UI - Refactors
WorkflowCrateExtractorto support both new workflow creation and new version creation with thedetect_workflowflag (renamed fromupdate_existing) - Implements reset-to-last-commit functionality in Git operations to prevent orphaned commits when creating versions
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| config/routes.rb | Adds route for create_version_from_ro_crate action |
| lib/seek/permissions/translator.rb | Adds permission for the new create_version_from_ro_crate action |
| app/controllers/workflows_controller.rb | Implements create_version_from_ro_crate action and renames methods for clarity (API vs UI handling) |
| app/controllers/concerns/legacy/workflow_support.rb | Renames legacy_handle_ro_crate_post to legacy_handle_ro_crate_api_post for consistency |
| app/forms/workflow_crate_extractor.rb | Refactors to support both new workflow and new version creation; renames update_existing to detect_workflow |
| app/views/workflows/new_git_version.html.erb | Adds RO-Crate upload tab to the new version form |
| app/views/workflows/provide_metadata.html.erb | Updates header to show "Version" for existing workflows and adds error display for versions |
| lib/git/operations.rb | Adds reset_to_last_local_commit method to revert to saved commits before performing new operations |
| config/locales/en.yml | Adds locale mapping for workflow_crate_extractor ActiveModel |
| test/unit/git/git_version_test.rb | Adds test for commit reset behavior |
| test/integration/git_workflow_versioning_test.rb | Adds integration tests for RO-Crate version creation including error handling |
| test/integration/workflow_versioning_test.rb | Adds assertion for error display |
| test/unit/git/git_workflow_wizard_test.rb | Updates commit hash from short to full format |
| test/integration/github_scraper_test.rb | Updates commit hash from short to full format |
| test/factories/workflows.rb | Updates commit hashes from short to full format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| test 'handles errors when creating version metadata' do | ||
| workflow = FactoryBot.create(:local_git_workflow) | ||
| person = workflow.contributor | ||
| original_version = workflow.latest_git_version |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to original_version is useless, since its value is never read.
| original_version = workflow.latest_git_version |
| person = workflow.contributor | ||
| original_version = workflow.latest_git_version | ||
|
|
||
| repo_count = Git::Repository.count |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to repo_count is useless, since its value is never read.
| repo_count = Git::Repository.count |
| original_version = workflow.latest_git_version | ||
|
|
||
| repo_count = Git::Repository.count | ||
| workflow_count = Workflow.count |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to workflow_count is useless, since its value is never read.
| workflow_count = Workflow.count |
|
|
||
| repo_count = Git::Repository.count | ||
| workflow_count = Workflow.count | ||
| version_count = Git::Version.count |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to version_count is useless, since its value is never read.
| version_count = Git::Version.count |
| repo_count = Git::Repository.count | ||
| workflow_count = Workflow.count | ||
| version_count = Git::Version.count | ||
| annotation_count = Git::Annotation.count |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to annotation_count is useless, since its value is never read.
| annotation_count = Git::Annotation.count |
| parent_commit = v1.commit | ||
| # Make a change to the repo, but don't save the change to the `commit` of the Git::Version | ||
| v1.add_file('text2.txt', StringIO.new('text2')) | ||
| orphaned_commit = v1.commit |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment to orphaned_commit is useless, since its value is never read.
| orphaned_commit = v1.commit |
Co-authored-by: Copilot <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.