Repository navigation
Various bug fixes + reliability improvements on the Framer fork #24
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
Open
ErikBooijFR
wants to merge
16
commits into
gmr:main
Choose a base branch
from
framer:feat/upstream-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9380e60
Make SSM parameters win over inherited env, as intended
ErikBooijFR e1716c0
Forward every caught signal, not just the first
ErikBooijFR ff09b5b
Signal the child directly instead of the parent's process group
ErikBooijFR 81b24c6
Install signal handler before starting the child
ErikBooijFR 6883a12
Forward all catchable signals to the child
ErikBooijFR c3b4e69
Exit with 128+N when the child is killed by a signal
ErikBooijFR 5db45fb
Stop flag parsing at the wrapped command
ErikBooijFR da1e5ba
Use distinct exit codes for tool errors and document them
ErikBooijFR 545e391
Warn on env key collisions and dedupe deterministically
ErikBooijFR ecc35ac
Default the version to dev for unversioned builds
ErikBooijFR b145f76
Require Go 1.26.5 to pick up the crypto/tls fix (GO-2026-5856)
ErikBooijFR c230e86
Scope release permissions to the release job
ErikBooijFR e2e1556
Pin release action to a commit SHA
ErikBooijFR 14806ea
Run tests with the race detector, matching CI
ErikBooijFR 6af0aee
Exit 125 on flag parsing errors
ErikBooijFR 6f356a8
Enforce Go 1.26.5 as the minimum version
ErikBooijFR 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 hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ $(TARGETS): go.mod | |
| make $(platform) | ||
|
|
||
| test: deps | ||
| $(GO) test | ||
| $(GO) test -race ./... | ||
|
|
||
| fmt: | ||
| $(GO) fmt | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,29 +1,57 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "maps" | ||
| "regexp" | ||
| "sort" | ||
| "slices" | ||
| "strings" | ||
|
|
||
| log "github.com/sirupsen/logrus" | ||
| ) | ||
|
|
||
| var InvalidPattern = regexp.MustCompile(`[^a-zA-Z0-9_]`) | ||
|
|
||
| func BuildEnvVars(parameters map[string]string, sanitize bool, strip bool, upcase bool) []string { | ||
| var vars []string | ||
| // MergeEnvVars combines the inherited environment with SSM-derived variables, | ||
| // letting Parameter Store win whenever a key is present in both. | ||
| // | ||
| // Precedence is expressed purely through ordering: os/exec de-duplicates | ||
| // cmd.Env before handing it to the child and keeps the last occurrence of each | ||
| // key, so ssmVars is appended second. Pass a nil environ to inherit nothing. | ||
| // The result is always non-nil, because a nil cmd.Env makes os/exec fall back | ||
| // to the parent's environment. | ||
| func MergeEnvVars(ssmVars []string, environ []string) []string { | ||
| merged := make([]string, 0, len(environ)+len(ssmVars)) | ||
| merged = append(merged, environ...) | ||
| merged = append(merged, ssmVars...) | ||
| return merged | ||
| } | ||
|
|
||
| for k, v := range parameters { | ||
| func BuildEnvVars(parameters map[string]string, sanitize bool, strip bool, upcase bool) []string { | ||
| // Transform in sorted parameter order so collisions resolve deterministically. | ||
| values := make(map[string]string, len(parameters)) | ||
| sources := make(map[string]string, len(parameters)) | ||
| for _, name := range slices.Sorted(maps.Keys(parameters)) { | ||
| key := name | ||
| if sanitize { | ||
| k = InvalidPattern.ReplaceAllString(k, "_") | ||
| key = InvalidPattern.ReplaceAllString(key, "_") | ||
| } | ||
| if strip { | ||
| k = InvalidPattern.ReplaceAllString(k, "") | ||
| key = InvalidPattern.ReplaceAllString(key, "") | ||
| } | ||
| if upcase { | ||
| k = strings.ToUpper(k) | ||
| key = strings.ToUpper(key) | ||
| } | ||
| vars = append(vars, fmt.Sprintf("%s=%s", k, v)) | ||
| if prev, ok := sources[key]; ok { | ||
| log.Warnf("Parameters %q and %q both map to %s; keeping the value of %q", prev, name, key, name) | ||
| } | ||
| sources[key] = name | ||
| values[key] = parameters[name] | ||
| } | ||
|
|
||
| vars := make([]string, 0, len(values)) | ||
| for key, value := range values { | ||
| vars = append(vars, key+"="+value) | ||
| } | ||
| sort.Strings(vars) | ||
| slices.Sort(vars) | ||
| return vars | ||
| } |
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module env-aws-params | ||
|
|
||
| go 1.26 | ||
| go 1.26.5 | ||
|
|
||
| require ( | ||
| github.com/aws/aws-sdk-go-v2 v1.41.7 | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.