-
Notifications
You must be signed in to change notification settings - Fork 750
Implementation of Git multiple revisions #6620
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: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
… operation Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
…f "master" Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Dr Marco De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Signed-off-by: Dr Marco Claudio De La Pierre <marco.delapierre@gmail.com>
Co-authored-by: Chris Hakkaart <chris.hakkaart@seqera.io> Signed-off-by: Jorge Ejarque <jorgee@users.noreply.github.com>
Co-authored-by: Chris Hakkaart <chris.hakkaart@seqera.io> Signed-off-by: Jorge Ejarque <jorgee@users.noreply.github.com>
|
@claude review |
|
Claude finished @jorgee's task —— View job Code Review Complete ✅I've completed a comprehensive review of the multi-revision asset management implementation. This is an excellent architectural improvement that addresses significant limitations in the current system while maintaining backward compatibility. Review Tasks:
🎯 Overall Assessment: APPROVED with Minor SuggestionsThis PR successfully implements a sophisticated solution to enable concurrent multi-revision pipeline execution while maintaining full backward compatibility. The Strategy pattern implementation is exemplary and the ADR provides excellent documentation of the decision-making process. ✅ Strengths1. Excellent Architectural Design
2. Robust Implementation
3. Well-Structured Code
4. Comprehensive Testing
5. Thorough Documentation
🔧 Minor Suggestions for Improvement1. Code Quality & MaintainabilityAssetManager.groovy:194-235 private RepositoryStrategyType selectStrategyType() {
// Consider extracting this logic to a separate strategy selector class
// as it may grow more complex with additional strategies
if( SysEnv.get('NXF_SCM_LEGACY') as boolean ) {
log.warn "Forcing to use legacy repository strategy (NXF_SCM_LEGACY is set to true)"
return RepositoryStrategyType.LEGACY
}
// ... rest of method
}MultiRevisionRepositoryStrategy.groovy:157-181 private void checkBareRepo(Manifest manifest) {
ensureBareRepoExists(manifest)
updateBareRepo(manifest)
}
private void ensureBareRepoExists(Manifest manifest) {
if( !hasBareRepo() ) {
// mutex logic and createBareRepo call
}
}2. Error Handling & User ExperienceAssetManager.groovy:212-216 case RepositoryStatus.LEGACY_ONLY:
log.info "Using legacy repository mode. To enable multi-revision support, run: nextflow pull ${project} -migrate"
type = RepositoryStrategyType.LEGACY
break3. Documentation EnhancementsCLI Documentation: Consider adding examples showing concurrent usage: # Run different versions simultaneously
nextflow run nextflow-io/hello -r v1.0 --input data.csv &
nextflow run nextflow-io/hello -r v2.0-dev --input data.csv &4. Testing CoverageMissing Test Scenarios:
🏗️ Implementation QualityStrategy Pattern ExcellenceThe Strategy pattern implementation is textbook quality:
Multi-Revision ArchitectureThis structure is optimal for:
🚀 Impact AssessmentUser Benefits
Developer Benefits
Performance Characteristics
🎯 Recommendation: APPROVE AND MERGEThis PR represents a significant architectural improvement that:
The suggested improvements are minor polish items that don't block merging. This is ready for production deployment. Special recognition for the excellent ADR documenting the decision-making process - this sets a great example for future architectural changes. |
Co-authored-by: Ben Sherman <bentshermann@gmail.com> Signed-off-by: Jorge Ejarque <jorgee@users.noreply.github.com>
Wow! great 😆 🚀 |
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
modules/nextflow/src/main/groovy/nextflow/scm/GithubRepositoryProvider.groovy
Outdated
Show resolved
Hide resolved
|
Little glitch, but likely there isn't much it can be done here |
Is this when running |
|
Yes |
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Signed-off-by: Jorge Ejarque <jorgee@users.noreply.github.com>
|
I can create another PR with a patch ignoring the path to backport to stable releases. |
…) [ci skip] Update the multi-revision asset management ADR: - Fix directory structure to match implementation: - bare/ instead of .nextflow/bare_repo/ - commits/ instead of .nextflow/commits/ - Legacy repo at separate location ~/.nextflow/assets/<project>/ - Merge Option 4 (Strategy Pattern) into Option 3 since the Strategy Pattern is an implementation detail of the multi-revision approach, not a standalone option Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
adr/20251205-multi-revision-asset-management-strategy-pattern.md
Outdated
Show resolved
Hide resolved
adr/20251205-multi-revision-asset-management-strategy-pattern.md
Outdated
Show resolved
Hide resolved
adr/20251205-multi-revision-asset-management-strategy-pattern.md
Outdated
Show resolved
Hide resolved
adr/20251205-multi-revision-asset-management-strategy-pattern.md
Outdated
Show resolved
Hide resolved
| │ │ └── tags/ | ||
| │ └── config | ||
| │ | ||
| └── commits/ # Commit-specific clones |
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.
| └── commits/ # Commit-specific clones | |
| └── revs/ # Revisions-specific clones |
It would be slightly naming this revs (shortcut revisions). Seems more suggest git internal commit organisation
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.
Not sure about this change. In this case we are storing the shared clone for a certain commit, not a revision. Revisions could also refer to tags and branches.
| 2. Detect repository state: | ||
| - `UNINITIALIZED` (no repo) → Use multi-revision (default for new) | ||
| - `LEGACY_ONLY` (only `.git/`) → Use legacy (preserve existing) | ||
| - `BARE_ONLY` (only bare repo) → Use multi-revision | ||
| - `HYBRID` (both exist) → Prefer multi-revision |
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.
Is not a bit over engineered. IMO it may be better to support default behaviour or legacy strategy
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.
I used the RepositoryStatus to clarify the selection of the strategy. Looking again, where it is used, I think it could be removed. Uninitialized is used in some commands to throw the abort exception and I think there is no difference for BARE_ONLY and HYBRID.
| * master (default) | ||
| mybranch | ||
| v1.1 [t] | ||
| * v1.1 [t] |
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.
Is this still reporting a useful info? likely can be removed since there isn't anymore the sticky concept
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.
Before it was just showing the current revision, now it is showing the revisions with a local clone. Not sure how useful is. It was in the original Marco's PR. The same code is used to update the current revisions.
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Signed-off-by: Jorge Ejarque <jorgee@users.noreply.github.com>
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Signed-off-by: Jorge Ejarque <jorgee@users.noreply.github.com>
Alternative for #5089
This pull request refactors revision and commit management for pipeline assets, streamlining how revisions are tracked and handled across CLI commands and internal logic. The main changes include removing the legacy revision map mechanism, updating CLI flags for clarity and consistency, and improving concurrency safety when cloning repositories. These updates simplify the codebase and improve reliability when managing pipeline versions.
Revision and Commit Management Refactor
REVISION_MAP,DEFAULT_REVISION_DIRNAME) fromAssetManager, including related methods (getRevisionMap,revisionToCommitWithMap,updateRevisionMap, etc.). Revision tracking now relies directly on branch/tag and commit information from the repository. [1] [2] [3] [4] [5]CLI Improvements
-a, -all-revisionsflag to-a, -allinCmdDropfor clarity, and updated help descriptions accordingly.-d, -deepflag fromCmdPullandCmdRun, and marked it as deprecated in documentation for future removal. [1] [2] [3] [4]Concurrency and Reliability
AssetManager.createSharedCloneto prevent concurrent clones of the same commit, ensuring safe and reliable asset downloads. [1] [2]Codebase Cleanup
CmdDrop.groovy,CmdList.groovy,CmdPull.groovy). [1] [2] [3]These changes collectively modernize revision tracking and asset management, making the system more robust and maintainable.