Skip to content

Commit

Permalink
chore: Application Rename (rhtap-cli)
Browse files Browse the repository at this point in the history
Renaming the last bits and making sure the application name is available
through a global contant.
  • Loading branch information
otaviof authored and Roming22 committed Jun 24, 2024
1 parent af516c6 commit 2cff2c5
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/__debug*
/.vscode/
/*.dll
/*.dylib
/*.exe
/*.exe~
/*.out
/*.so
/*.test
/.vscode/
/__debug*
/bin
/rhtap-installer-cli
/rhtap-cli
/tmp
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
rhtapInstallerCLI:
rhtapCLI:
namespace: &installerNamespace rhtap
features:
crc:
Expand Down
5 changes: 2 additions & 3 deletions pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import (
"os"

"github.com/redhat-appstudio/rhtap-cli/pkg/config"
"github.com/redhat-appstudio/rhtap-cli/pkg/constants"
"github.com/redhat-appstudio/rhtap-cli/pkg/flags"
"github.com/redhat-appstudio/rhtap-cli/pkg/k8s"
"github.com/redhat-appstudio/rhtap-cli/pkg/subcmd"

"github.com/spf13/cobra"
)

const AppName = "rhtap-installer-cli"

// RootCmd is the root command.
type RootCmd struct {
cmd *cobra.Command // root command
Expand Down Expand Up @@ -44,7 +43,7 @@ func NewRootCmd() *RootCmd {
r := &RootCmd{
flags: f,
cmd: &cobra.Command{
Use: AppName,
Use: constants.AppName,
Short: "RHTAP Installer CLI",
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return cfg.UnmarshalYAML()
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type Config struct {
// configPath is the path to the configuration file, private attribute.
configPath string
// Installer is the root configuration for the installer.
Installer Spec `yaml:"rhtapInstallerCLI"`
Installer Spec `yaml:"rhtapCLI"`
}

// PersistentFlags defines the persistent flags for the CLI.
Expand Down
4 changes: 4 additions & 0 deletions pkg/constants/contants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package constants

// AppName is the name of the application.
const AppName = "rhtap-cli"
4 changes: 3 additions & 1 deletion pkg/githubapp/githubapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"path/filepath"
"time"

"github.com/redhat-appstudio/rhtap-cli/pkg/constants"

"github.com/google/go-github/scrape"
"github.com/google/go-github/v60/github"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -82,7 +84,7 @@ func (g *GitHubApp) oAuth2Workflow(
g.log().Debug("oAuth code obtained")
oAuthCodeCh <- code
g.log().Info("GitHub App successfully created!")
fmt.Fprintf(w, gitHubAppSuccessfullyCreatedTmpl, *manifest.Name)
fmt.Fprintf(w, gitHubAppSuccessfullyCreatedTmpl, *manifest.Name, constants.AppName)
} else {
gitHubURL := g.gitHubURL
// when the GitHub organization name is informed, using it to create
Expand Down
2 changes: 1 addition & 1 deletion pkg/githubapp/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const gitHubAppSuccessfullyCreatedTmpl = `
You have successfully created a new GitHub App %q, go back to the CLI to
finish the installation:
<pre>
$ rhtap-installer-cli deploy
$ %s deploy
</pre>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion pkg/subcmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ configuration to identify the features to be installed, and the dependencies to
resolved.
The deployment configuration file describes the sequence of Helm charts to be
applied, on the attribute 'rhtapInstallerCLI.dependencies[]'.
applied, on the attribute 'rhtapCLI.dependencies[]'.
The platform configuration is rendered from the values template file
(--values-template), this configuration payload is given to all Helm charts.
Expand Down
5 changes: 4 additions & 1 deletion pkg/subcmd/developerhub_githubapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"log/slog"

"github.com/redhat-appstudio/rhtap-cli/pkg/config"
"github.com/redhat-appstudio/rhtap-cli/pkg/constants"
"github.com/redhat-appstudio/rhtap-cli/pkg/githubapp"
"github.com/redhat-appstudio/rhtap-cli/pkg/k8s"
"github.com/redhat-appstudio/rhtap-cli/pkg/rhdh"
Expand Down Expand Up @@ -92,7 +93,9 @@ func (d *DeveloperHubGitHubApp) Run() error {
}
if d.update {
// TODO: implement update.
panic("TODO: 'rhtap-installer-cli developer-hub github-app --update'")
panic(fmt.Sprintf(
"TODO: '%s developer-hub github-app --update'", constants.AppName,
))
}
return nil
}
Expand Down

0 comments on commit 2cff2c5

Please sign in to comment.