Skip to content

init: update the default sample Score file generated#476

Merged
mathieu-benoit merged 2 commits into
score-spec:mainfrom
Abhishek9639:feat/update-default-sample-score-file
Apr 27, 2026
Merged

init: update the default sample Score file generated#476
mathieu-benoit merged 2 commits into
score-spec:mainfrom
Abhishek9639:feat/update-default-sample-score-file

Conversation

@Abhishek9639
Copy link
Copy Markdown
Contributor

Description

The default score.yaml generated by score-compose init used a basic nginx example that didn't really show what Score is capable of. This PR replaces it with a more meaningful sample that demonstrates resource provisioning, environment variable substitution, and routing things that actually help a new user understand why Score is useful.

What does this PR do?

Closes #475

Updates DefaultScoreFileContent in internal/command/init.go to generate a richer sample score.yaml that:

  • Uses scorespec/sample-score-app:latest instead of nginx
  • Provisions a postgres database resource and injects its connection details as environment variables (DB_HOST, DB_PORT, DB_DATABASE, etc.)
  • Provisions a dns resource and a route resource for HTTP routing
  • Points to the Getting Started guide: https://docs.score.dev/docs/get-started/

All three resource types (postgres, dns, route) are included in the default provisioners, so score-compose generate works out of the box with no extra setup needed.

Also updated TestInitNominal and TestInitAndGenerate_with_sample to reflect the new sample structure.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

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

@Abhishek9639
Copy link
Copy Markdown
Contributor Author

Hi @mathieu-benoit,
I've raised a PR for this. Updated the default sample in init.go as suggested, and adjusted the related tests accordingly. All tests pass locally.
Please take a look when you get a chance, happy to make any changes.
Thanks

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.

Thanks! Small feedback to remove the empty lines in the Score file please.

Comment thread internal/command/init.go Outdated
…ning, and env vars (fixes score-spec#475)

Signed-off-by: Abhishek <abhishekup082@gmail.com>
@Abhishek9639 Abhishek9639 force-pushed the feat/update-default-sample-score-file branch from 9832797 to 4cbdb47 Compare April 27, 2026 07:36
@Abhishek9639
Copy link
Copy Markdown
Contributor Author

Hi @mathieu-benoit,
Done, removed the empty lines from the Score file.
Thanks for the feedback.

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.

Quick question of my final review.

Comment thread internal/command/init_test.go
@mathieu-benoit mathieu-benoit self-requested a review April 27, 2026 13:15
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

@mathieu-benoit mathieu-benoit merged commit 60795ab into score-spec:main Apr 27, 2026
8 checks passed
@Abhishek9639
Copy link
Copy Markdown
Contributor Author

Hii @mathieu-benoit,
I have sent the draft of "Project Melody" to the link you shared. Please review it once. Also, could you let me know whether you are planning to apply for a CNCF project for Term 2 or not?
Thanks

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.

init - Update the default sample Score file generated

2 participants