Skip to content

Changes made for provisoners flag#221

Merged
astromechza merged 9 commits intoscore-spec:mainfrom
rabelmervin:new
Mar 10, 2025
Merged

Changes made for provisoners flag#221
astromechza merged 9 commits intoscore-spec:mainfrom
rabelmervin:new

Conversation

@rabelmervin
Copy link
Copy Markdown
Contributor

Initially the provisioners flag doesnt support local file and stdin. But now local and stdin added

@mathieu-benoit
Copy link
Copy Markdown
Contributor

Thanks, @rabelmervin!

You need to sign your commits to have the DCO passing successfully on this PR:

To add your Signed-off-by line to every commit in this branch:
Ensure you have a local copy of your branch by checking out the pull request locally via command line.
In your local branch, run: git rebase HEAD~1 --signoff
Force push your changes to overwrite the branch: git push --force-with-lease origin new

@rabelmervin
Copy link
Copy Markdown
Contributor Author

Hello @mathieu-benoit @astromechza I have signed the commits and DCO is passed successfully :) Is there anything i can help you with ?

@7h3-3mp7y-m4n
Copy link
Copy Markdown
Contributor

7h3-3mp7y-m4n commented Dec 14, 2024

hey, @rabelmervin I'm not a reviewer but can you also update the test case over here https://github.com/score-spec/score-compose/blob/main/internal/command/init_test.go#L79
Can you also add the test case for your function?

provisioner.yaml Outdated
@@ -0,0 +1,35 @@
# Score provides a developer-centric and platform-agnostic
Copy link
Copy Markdown
Contributor

@7h3-3mp7y-m4n 7h3-3mp7y-m4n Dec 16, 2024

Choose a reason for hiding this comment

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

I think @rabelmervin you should not add this file cause it's irrelevant to issue #220
Also, it is of no use.

score.yaml Outdated
Comment on lines +1 to +35
# Score provides a developer-centric and platform-agnostic
# Workload specification to improve developer productivity and experience.
# Score eliminates configuration management between local and remote environments.
#
# Specification reference: https://docs.score.dev/docs/reference/score-spec-reference/
---

# Score specification version
apiVersion: score.dev/v1b1

metadata:
name: example

containers:
hello-world:
image: nginx:latest

# Uncomment the following for a custom entrypoint command
# command: []

# Uncomment the following for custom arguments
# args: []

# Environment variables to inject into the container
variables:
EXAMPLE_VARIABLE: "example-value"

service:
ports:
# Expose the http port from nginx on port 8080
www:
port: 8080
targetPort: 80

resources: {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same for this, If you want to add examples, you should refer to this and in a separate PR.

@rabelmervin
Copy link
Copy Markdown
Contributor Author

rabelmervin commented Dec 16, 2024

Hi @7h3-3mp7y-m4n I'll the add the test functions and I'll remove that irrelevant files 👍


var saveFilename string
if vi == "-" {
saveFilename = fmt.Sprintf("stdin-provisioner-%d%s", i+1, loader.DefaultSuffix)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The file name here needs to look like a provisioners file. I'd also suggest dropping the %d suffix since we can only ever have one stdin file.

Suggested change
saveFilename = fmt.Sprintf("stdin-provisioner-%d%s", i+1, loader.DefaultSuffix)
saveFilename = "from-stdin.provisioners.yaml"

Copy link
Copy Markdown
Contributor Author

@rabelmervin rabelmervin Jan 7, 2025

Choose a reason for hiding this comment

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

sure @astromechza @mathieu-benoit I'll make changes !. Is there anything i can help you with ?

"github.com/score-spec/score-compose/internal/provisioners/loader"
)

func GetStdinFile(ctx context.Context) ([]byte, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we please move this functionality over to https://github.com/score-spec/score-go/blob/main/uriget/uriget.go#L155 as part of the file type getter? This is a good place to add unit tests too.

This is common functionality that we can use and document in all the consumers of this library. This would allow the uri to be documented as either: file://- or just -.

I can help get this turned around quickly :)

@rabelmervin
Copy link
Copy Markdown
Contributor Author

rabelmervin commented Jan 17, 2025

Hi @mathieu-benoit and @astromechza Now the Test is passed. I'll commit the changes What's your opinion ?

Screenshot (12)

@astromechza
Copy link
Copy Markdown
Member

@rabelmervin Thanks! can you address the remaining comments on the diff, including this one for score-go? https://github.com/score-spec/score-compose/pull/221/files#r1904017231

@rabelmervin
Copy link
Copy Markdown
Contributor Author

Bonjour @mathieu-benoit @astromechza I made changes ! I have Moved the GetStdinFile functionality to uriget.go present in score-go as part of GetFile score-spec/score-go#85

Signed-off-by: rabelmervin <rabelmervin@gmail.com>
Signed-off-by: rabelmervin <rabelmervin@gmail.com>
Signed-off-by: rabelmervin <rabelmervin@gmail.com>
Signed-off-by: rabelmervin <rabelmervin@gmail.com>
Signed-off-by: rabelmervin <rabelmervin@gmail.com>
@7h3-3mp7y-m4n
Copy link
Copy Markdown
Contributor

I have proposed some changes to your score-go PR
Please wait for @astromechza or @mathieu-benoit to review it, Thanks!

@astromechza
Copy link
Copy Markdown
Member

@rabelmervin your score-go PR is now released under https://github.com/score-spec/score-go/releases/tag/v1.9.2 and can be imported here :)

@mathieu-benoit
Copy link
Copy Markdown
Contributor

Hi @rabelmervin, while we were reviewing the projects status in preparation of KubeCon, we were wondering if you could continue on this one? Thanks again for your contributions!

@rabelmervin
Copy link
Copy Markdown
Contributor Author

rabelmervin commented Mar 6, 2025

Ohh ! I forgot this, Sure I'll complete this @mathieu-benoit @astromechza but, could you please tell me what yet to be addressed in this pr ?

Signed-off-by: Rabel Mervin  <152761588+rabelmervin@users.noreply.github.com>
Copy link
Copy Markdown
Member

@astromechza astromechza left a comment

Choose a reason for hiding this comment

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

There are a few remaining bits to clean up here :) @rabelmervin

Comment on lines +202 to +210
var data []byte

if vi == "-" {
data, err = uriget.GetFile(cmd.Context(), "-")
} else {
// Existing URI loading logic
data, err = uriget.GetFile(cmd.Context(), vi)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

None of this is necessary due to line 211 below. it's exactly the same.

timeout: 10s
retries: 120
info_logs: |
info_logs: |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is incorrect, the info logs section needs to be indented only 2 spaces, it's a top level field.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In fact I don't think any changes are necessary to this file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, I'll not make any changes to this

rabelmervin and others added 2 commits March 8, 2025 13:46
Signed-off-by: rabelmervin <rabelmervin@gmail.com>
@rabelmervin
Copy link
Copy Markdown
Contributor Author

Hello @astromechza i have made some changes.

@rabelmervin rabelmervin requested a review from astromechza March 8, 2025 16:01
Signed-off-by: Ben Meier <1651305+astromechza@users.noreply.github.com>
Copy link
Copy Markdown
Member

@astromechza astromechza left a comment

Choose a reason for hiding this comment

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

Thanks, @rabelmervin, for your contribution and working through the feedback. I really appreciate it. :)

@astromechza astromechza merged commit ecd9290 into score-spec:main Mar 10, 2025
4 checks passed
@rabelmervin
Copy link
Copy Markdown
Contributor Author

rabelmervin commented Mar 10, 2025

Hurray, I'm over the moon thanks @astromechza and @mathieu-benoit Merci beaucoup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] score-compose init --provisioners flag doesn't document local file option and doesn't support stdin

4 participants