Skip to content
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

feat: initial scaffolding for directive validation and git-based directives #4

Conversation

krancour
Copy link

No description provided.

@krancour krancour changed the title initial scaffolding for directive validation and git-based directives feat: initial scaffolding for directive validation and git-based directives Aug 28, 2024
@krancour krancour force-pushed the krancour/alt-promotion-directives branch from b6be5b7 to 5573655 Compare August 28, 2024 17:05
@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 83.33333% with 17 lines in your changes missing coverage. Please review.

Please upload report for BASE (promotion-directives@367ad99). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/directives/engine.go 64.70% 3 Missing and 3 partials ⚠️
internal/directives/git_clone_directive.go 87.50% 2 Missing and 1 partial ⚠️
internal/directives/git_commit_directive.go 83.33% 2 Missing and 1 partial ⚠️
internal/directives/git_push_directive.go 83.33% 2 Missing and 1 partial ⚠️
internal/directives/validation.go 80.00% 1 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                   Coverage Diff                   @@
##             promotion-directives       #4   +/-   ##
=======================================================
  Coverage                        ?   48.51%           
=======================================================
  Files                           ?      255           
  Lines                           ?    17897           
  Branches                        ?        0           
=======================================================
  Hits                            ?     8683           
  Misses                          ?     8778           
  Partials                        ?      436           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@krancour krancour force-pushed the krancour/alt-promotion-directives branch from 5573655 to 534e188 Compare August 28, 2024 21:00
Comment on lines +168 to +187
.PHONY: codegen-docs
codegen-docs:
npm install -g @bitnami/readme-generator-for-helm
bash hack/helm-docs/helm-docs.sh

Copy link
Author

Choose a reason for hiding this comment

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

No changes here. I just re-ordered the targets so they are defined in the same order they are executed when using make codegen. I thought it made it slightly easier to follow.

Comment on lines +22 to +23
sed -i.bak 's/\*bool/bool/g' ${out_file}
sed -i.bak 's/\*string/string/g' ${out_file}
Copy link
Author

Choose a reason for hiding this comment

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

The tool uses pointers for anything optional, which is annoying AF for strings and bools (maybe ints, too). There wasn't a flag to change that behavior, so I resorted to this.

@@ -6,7 +6,7 @@ import (
"fmt"
)

func init() {
func init() {
Copy link
Author

Choose a reason for hiding this comment

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

Linter caught this.

@@ -92,4 +92,3 @@ func configToStruct[T any](c Config) (T, error) {

return result, nil
}

Copy link
Author

Choose a reason for hiding this comment

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

Linter caught this.

@@ -17,7 +17,6 @@ func BuiltinsRegistry() DirectiveRegistry {
// register and retrieve directives by name.
type DirectiveRegistry map[string]Directive


Copy link
Author

Choose a reason for hiding this comment

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

Linter caught this.

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@krancour krancour force-pushed the krancour/alt-promotion-directives branch from 534e188 to 7a314f8 Compare August 30, 2024 11:53
…privileges

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
…f a dir

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
@@ -47,11 +47,11 @@ func NewEngine(
// Execute runs the provided list of directives in sequence.
func (e *Engine) Execute(ctx context.Context, steps []Step) (Result, error) {
// TODO(hidde): allow the workDir to be restored from a previous execution.
workDir, err := os.CreateTemp("", "run-")
workDir, err := os.MkdirTemp("", "run-")
Copy link
Owner

Choose a reason for hiding this comment

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

🤦 doh.

Copy link
Owner

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

We already talked through the details of this offline, so lets just get it merged. 💯

@hiddeco hiddeco merged commit 38fe212 into hiddeco:promotion-directives Aug 30, 2024
10 checks passed
@krancour krancour deleted the krancour/alt-promotion-directives branch September 27, 2024 17:37
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.

3 participants