-
-
Notifications
You must be signed in to change notification settings - Fork 152
Comparing changes
Open a pull request
base repository: alecthomas/kong
base: v1.8.1
head repository: alecthomas/kong
compare: v1.9.0
- 9 commits
- 27 files changed
- 5 contributors
Commits on Feb 17, 2025
-
ci: Test with Go 1.23 and 1.24 (#502)
In CI, test with Go 1.23 and 1.24, and upgrade the Hermit-managed Go and golangci-lint to latest versions. The new golangci-lint had a number of warnings and minor issues that were either fixed or opted-out of.
Configuration menu - View commit details
-
Copy full SHA for 9f71a49 - Browse repository at this point
Copy the full SHA 9f71a49View commit details -
chore(deps): update module github.com/alecthomas/kong to v1.8.1 (#503)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 7f94c90 - Browse repository at this point
Copy the full SHA 7f94c90View commit details -
feat: Support singleton providers (#501)
* feat: Support singleton providers This change adds support for provider functions that are not reinvoked even if requested by multiple other providers. Instead, their value is cached and reused between invocations. To make this possible, we change how bindings are stored: instead of just a function reference, we now store a binding object which records whether the binding is a singleton, and records the resolved singleton value (if any). Resolves #500 * refac(bindings): hide singleton status Don't require callAnyFunction to be aware of whether a binding is a singleton or not.
Configuration menu - View commit details
-
Copy full SHA for 3b9af5b - Browse repository at this point
Copy the full SHA 3b9af5bView commit details -
feat: Allow ignoring fields from embedded structs (#499)
If a field in a struct is ignored with `kong:"-"`, any embedded fields with the same name are also ignored. This allows an outer struct to remove flags from an embedded struct by redefining it and adding a kong ignore tag.
Configuration menu - View commit details
-
Copy full SHA for 300cba8 - Browse repository at this point
Copy the full SHA 300cba8View commit details
Commits on Feb 26, 2025
-
Configuration menu - View commit details
-
Copy full SHA for 0c495e4 - Browse repository at this point
Copy the full SHA 0c495e4View commit details
Commits on Mar 7, 2025
-
feat: Allow kong.Path to describe remaining unparsed args (#472)
As Kong traces a sequence of command line arguments, it parses them and appends them to the parsed `Path` sequence. For each element in `Path`, these is a corresponding sequence of unparsed arguments. This change enables `Path` to yield these. I have a package that uses Kong's hooks to instrument Kong applications (to monitor usage, reliability, etc of internal tools). I would like to instrument the commandline arguments as well. This change would enable it to work roughly as follows: ```golang func (Foo) BeforeApply(app *kong.Kong, ctx *kong.Context, t *Tracker) error { command := []string{ctx.Model.Name} var args []string for _, path := range ctx.Path { if path.Command != nil { command = append(command, path.Command.Name) args = path.Remainder() } } app.Exit = t.exit(app.Exit) t.WithCommand(strings.Join(command, " ")).WithArgs(args) return nil } ```
Configuration menu - View commit details
-
Copy full SHA for 5b36573 - Browse repository at this point
Copy the full SHA 5b36573View commit details
Commits on Mar 8, 2025
-
Configuration menu - View commit details
-
Copy full SHA for 73db2e8 - Browse repository at this point
Copy the full SHA 73db2e8View commit details
Commits on Mar 11, 2025
-
feat: Allow Kong to exit with semantic exit codes (#507)
* feat: Allow Kong to exit with semantic exit codes At Block, we've instrumented a number of commandline tools and set SLOs on some tools' reliability. To do that effectively, we had to partition usage errors from reliability issues. We looked at [prior art](https://github.com/square/exit?tab=readme-ov-file#reserved-codes-and-prior-art) and, taking inspiration from HTTP, defined [a set of semantic exit codes](https://github.com/square/exit?tab=readme-ov-file#about) in ranges: 80-99 for user errors, 100-119 for system errors. We've been wrapping errors in `exit.Error` at whatever level of the stack can tell which class an error is and unwrapping them at exit (`os.Exit(exit.FromError(err))`). This adds support for semantic exit codes to Kong, to `FatalIfErrorf`, which is used internally by `kong.Parse` and often used in Kong applications. * feat: Exit 80 (Usage Error) when usage is syntactically or semantically invalid * refactor: Always exit 80 (Usage Error) on a `ParseError` but don't wrap errors from hooks in `ParseError`
Configuration menu - View commit details
-
Copy full SHA for a86adbb - Browse repository at this point
Copy the full SHA a86adbbView commit details -
refactor: ParseError can carry an exit code
Reinstated use of ParseError for all error paths so as to retain existing semantics.
Configuration menu - View commit details
-
Copy full SHA for 3d03233 - Browse repository at this point
Copy the full SHA 3d03233View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.8.1...v1.9.0