Skip to content

feat: add support for importing multiple provisioners files from a local directory#465

Merged
mathieu-benoit merged 1 commit into
score-spec:mainfrom
Venkatesh1505:feat/import-multiple-files-from-folder
Apr 14, 2026
Merged

feat: add support for importing multiple provisioners files from a local directory#465
mathieu-benoit merged 1 commit into
score-spec:mainfrom
Venkatesh1505:feat/import-multiple-files-from-folder

Conversation

@Venkatesh1505
Copy link
Copy Markdown
Contributor

@Venkatesh1505 Venkatesh1505 commented Apr 13, 2026

Description

This PR makes two changes:

  1. Replace uriget.GetFile with uriget.GetFiles for the --provisioners flag in the init command. When a local directory path is passed, all files in
    the directory are imported individually, sorted by name. Single file paths and remote URIs continue to work as before.

  2. Rework SaveProvisionerToDirectory to drop the time-based prefix from saved provisioner filenames. Instead, the original base name from the
    source URI is preserved along with a hash suffix. This ensures that files with explicit ordering prefixes (e.g., 10-, 20-) retain their intended
    load order when read from the state directory.

Depends on: score-spec/score-go#(180) — adds the GetFiles function to the uriget package.

Note: This PR currently uses a local replace directive in go.mod pointing to the score-go branch. This should be updated to the released score-go
version before merging.

What does this PR do?

Relates to score-spec/score-go#177

Enables users to pass a local directory to --provisioners during score-compose init, importing all provisioner files from that directory in a
single command. Previously, each file had to be specified individually.

Before:
score-compose init
--provisioners ./provisioners/10-service.provisioners.yaml
--provisioners ./provisioners/20-redis.provisioners.yaml

After:
score-compose init --provisioners ./provisioners/

The saved filenames now preserve the original name and ordering:
Before: meaningless base64 names
f0B3kQ2x.a8Dk3mP9qR.provisioners.yaml

After: readable, ordered

10-service.a8Dk3mP9qR.provisioners.yaml
20-redis.b7Ck2lO8pQ.provisioners.yaml

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • New chore (expected functionality to be implemented)

Checklist:

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I've signed off with an email address that matches the commit author.

Comment thread go.mod Outdated
Comment thread internal/provisioners/loader/load.go Outdated
@Venkatesh1505 Venkatesh1505 force-pushed the feat/import-multiple-files-from-folder branch from 7e8a598 to 47d78cd Compare April 13, 2026 16:36
Comment thread go.mod Outdated
@Venkatesh1505 Venkatesh1505 changed the title Feat/import multiple files from folder feat: add support for importing multiple files from a local directory Apr 13, 2026
Copy link
Copy Markdown
Contributor

@mathieu-benoit mathieu-benoit left a comment

Choose a reason for hiding this comment

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

This LGTM, awesome!

Really appreciate the rigorous research, documentation and tests, really great to review with such context!

I just have a question for the stdin scenario. Let's validate this before approving this dependency score-spec/score-go#180.

Notes:

  • Not approving yet as we'll need to approve/merge/release the score-go dependency first
  • It's totally fine to just implement this for file. We can release this when ready and already have end users using it and provide feedback if needed. For oci and git will come later in future PR.

Comment thread internal/command/init.go
Comment thread internal/provisioners/loader/load.go Outdated
@Venkatesh1505 Venkatesh1505 force-pushed the feat/import-multiple-files-from-folder branch from 47d78cd to 494c479 Compare April 14, 2026 16:49
…ectory

Signed-off-by: Venkatesh R <venkyravi97@gmail.com>
@Venkatesh1505 Venkatesh1505 force-pushed the feat/import-multiple-files-from-folder branch from 494c479 to a7d3593 Compare April 14, 2026 18:16
Copy link
Copy Markdown
Contributor

@mathieu-benoit mathieu-benoit left a comment

Choose a reason for hiding this comment

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

LGTM, thanks, @Venkatesh1505!

Let's do this for score-k8s now 😄

@mathieu-benoit mathieu-benoit merged commit 27d4dfc into score-spec:main Apr 14, 2026
8 checks passed
@Venkatesh1505 Venkatesh1505 changed the title feat: add support for importing multiple files from a local directory feat: add support for importing multiple provisioners files from a local directory Apr 16, 2026
@mathieu-benoit
Copy link
Copy Markdown
Contributor

FYI: associated docs updated accordingly: score-spec/docs#278

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.

2 participants