This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
GSP-137: Service Output Template #137
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
- Author: Xuanwo <[email protected]> | ||
- Start Date: 2021-07-07 | ||
- RFC PR: [beyondstorage/specs#137](https://github.com/beyondstorage/specs/issues/137) | ||
- Tracking Issue: [beyondstorage/go-storage#0](https://github.com/beyondstorage/go-storage/issues/0) | ||
|
||
# GSP-137: Service Output Template | ||
|
||
## Background | ||
|
||
[Increase code coverage](https://github.com/beyondstorage/go-storage/issues/620) plans to move `cmd/definitions/tests` into `tests` and support generating files into `generate_test.go` so we won't export test services. | ||
|
||
So `definitions` should have the ability to generate all files into a specified output filename template. | ||
|
||
## Proposal | ||
|
||
I propose to add a new field `output_template` in `service.toml`. In `output_template`, we will use format string like `%s_test.go`. | ||
|
||
If service provider specify `output_template` to `%s_test.go`, `definitions` will generate files into: | ||
|
||
- `generated_test.go` | ||
- `service_test.go` | ||
- `storage_test.go` | ||
Comment on lines
+18
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
## Rationale | ||
|
||
N/A | ||
|
||
## Compatibility | ||
|
||
This GSP introduces a compatible change. | ||
|
||
## Implementation | ||
|
||
- Add `output_template` field in specs. | ||
- Support `output_template` in go-storage. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we actually need this feature in
definitions
? If we just want to changetests
, we can simply write some scripts inMakefile
?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.
You are right. The feature is used in
tests
services only. I will abort this GSP and use scripts instead.