Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a5435bf

Browse files
committed
chore: remove pgexplain tips
1 parent 82a6edd commit a5435bf

File tree

15 files changed

+9
-482
lines changed

15 files changed

+9
-482
lines changed

‎Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ RUN apk add --no-cache bash postgresql-client
55
WORKDIR /home/
66

77
COPY ./bin/joe ./bin/joe
8-
COPY ./configs/explain ./explain
98

109
EXPOSE $SERVER_PORT
1110

‎Dockerfile.ee

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ RUN apk add --no-cache bash postgresql-client
55
WORKDIR /home/
66

77
COPY ./bin/joe-ee ./bin/joe
8-
COPY ./configs/explain ./explain
98

109
EXPOSE $SERVER_PORT
1110

‎cmd/joe/main.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@ func loadAppConfig() (*config.Config, error) {
103103

104104
botCfg.Enterprise = enterpriseOptions
105105

106-
// Load and validate an explain configuration file.
107-
explainConfig, err := config.LoadExplainConfig()
108-
if err != nil {
109-
return nil, errors.Wrap(err, "failed to load an explain config")
110-
}
111-
112-
botCfg.Explain = explainConfig
113-
114106
return &botCfg, nil
115107
}
116108

‎configs/explain/explain.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎pkg/bot/command/explain.go

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343

4444
// Explain runs an explain query.
4545
func Explain(ctx context.Context, msgSvc connection.Messenger, command *platform.Command, msg *models.Message,
46-
explainConfig pgexplain.ExplainConfig, session usermanager.UserSession) error {
46+
session usermanager.UserSession) error {
4747
if command.Query == "" {
4848
return errors.New(MsgExplainOptionReq)
4949
}
@@ -100,7 +100,7 @@ func Explain(ctx context.Context, msgSvc connection.Messenger, command *platform
100100
command.PlanExecJSON = explainAnalyze
101101

102102
// Visualization.
103-
explain, err := pgexplain.NewExplain(explainAnalyze, explainConfig)
103+
explain, err := pgexplain.NewExplain(explainAnalyze)
104104
if err != nil {
105105
log.Err("Explain parsing: ", err)
106106

@@ -156,32 +156,6 @@ func Explain(ctx context.Context, msgSvc connection.Messenger, command *platform
156156
return err
157157
}
158158

159-
// Recommendations.
160-
tips, err := explain.GetTips()
161-
if err != nil {
162-
log.Err("Recommendations: ", err)
163-
return err
164-
}
165-
166-
recommends := ""
167-
if len(tips) == 0 {
168-
recommends += ":white_check_mark: Looks good"
169-
} else {
170-
for _, tip := range tips {
171-
recommends += fmt.Sprintf(
172-
":exclamation: %s – %s <%s|Show details>\n", tip.Name,
173-
tip.Description, tip.DetailsUrl)
174-
}
175-
}
176-
177-
command.Recommendations = recommends
178-
179-
msg.AppendText("*Recommendations:*\n" + recommends)
180-
if err = msgSvc.UpdateText(msg); err != nil {
181-
log.Err("Show recommendations: ", err)
182-
return err
183-
}
184-
185159
// Summary.
186160
stats := explain.RenderStats()
187161
command.Stats = stats

‎pkg/config/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"time"
1010

1111
"gitlab.com/postgres-ai/joe/features/definition"
12-
"gitlab.com/postgres-ai/joe/pkg/pgexplain"
1312
)
1413

1514
const (
@@ -32,7 +31,6 @@ type Config struct {
3231
Platform Platform `yaml:"platform"`
3332
Registration Registration `yaml:"registration"`
3433
ChannelMapping *ChannelMapping `yaml:"channelMapping"`
35-
Explain pgexplain.ExplainConfig `yaml:"-"`
3634
Enterprise definition.EnterpriseOptions `yaml:"-"`
3735
}
3836

‎pkg/config/pgexplain.go

Lines changed: 0 additions & 67 deletions
This file was deleted.

‎pkg/connection/slack/assistant.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ func (a *Assistant) buildMessageProcessor(channelID string, dbLabInstance *dblab
124124
processingCfg := msgproc.ProcessingConfig{
125125
App: a.appCfg.App,
126126
Platform: a.appCfg.Platform,
127-
Explain: a.appCfg.Explain,
128127
DBLab: dbLabInstance.Config(),
129128
EntOpts: a.appCfg.Enterprise,
130129
Project: a.appCfg.Platform.Project,

‎pkg/connection/slackrtm/assistant.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ func (a *Assistant) buildMessageProcessor(channelID string, dbLabInstance *dblab
125125
processingCfg := msgproc.ProcessingConfig{
126126
App: a.appCfg.App,
127127
Platform: a.appCfg.Platform,
128-
Explain: a.appCfg.Explain,
129128
DBLab: dbLabInstance.Config(),
130129
EntOpts: a.appCfg.Enterprise,
131130
Project: a.appCfg.Platform.Project,

‎pkg/connection/slacksm/assistant.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ func (a *Assistant) buildMessageProcessor(channelID string, dbLabInstance *dblab
142142
processingCfg := msgproc.ProcessingConfig{
143143
App: a.appCfg.App,
144144
Platform: a.appCfg.Platform,
145-
Explain: a.appCfg.Explain,
146145
DBLab: dbLabInstance.Config(),
147146
EntOpts: a.appCfg.Enterprise,
148147
Project: a.appCfg.Platform.Project,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /