The LaunchDarkly team monitors the issue tracker in the repository. Bug reports and feature requests should be filed in this issue tracker.
We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly team will add themselves.
To install the repo's git hooks, run make install-hooks
.
pre-commit
The pre-commit hook checks that relevant project files are formatted with go fmt
, and that
the go.mod/go.sum
files are tidy.
In addition, pre-commit will run dev server UI tests and build the project to make sure an up-to-date build is being checked in. You will need to install npm.
There are a few things you need to do in order to wire up a new top-level command.
- Add your command to the root command by calling
cmd.AddComand
in theNewRootCommand
method of thecmd
package. - Update the root command's usage template by modifying the
getUsageTemplate
method in thecmd
package. - Instrument your command by setting a
PreRun
orPersistentPreRun
on your command which callstracker.SendCommandRunEvent
. Example below.
cmd := &cobra.Command{
Use: "dev-server",
Short: "Development server",
Long: "Start and use a local development server for overriding flag values.",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
tracker := analyticsTrackerFn(
viper.GetString(cliflags.AccessTokenFlag),
viper.GetString(cliflags.BaseURIFlag),
viper.GetBool(cliflags.AnalyticsOptOut),
)
tracker.SendCommandRunEvent(cmdAnalytics.CmdRunEventProperties(
cmd,
"dev-server",
map[string]interface{}{
"action": cmd.Name(),
}))
},
}