-
Notifications
You must be signed in to change notification settings - Fork 280
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
[IRM] - changes to get incident working in IRM plugin #4987
Changes from all commits
d424c50
5a904c9
f7d96f0
ce3d639
e56d5ef
8466222
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/grafana-labs/grafana-oncall-app | ||
module github.com/grafana/grafana-oncall-app | ||
|
||
go 1.21.5 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -317,32 +317,29 @@ func (a *App) SaveOnCallSettings(settings *OnCallPluginSettings) error { | |
return nil | ||
} | ||
|
||
func (a *App) GetSyncData(ctx context.Context, settings *OnCallPluginSettings) (*OnCallSync, error) { | ||
func (a *App) GetSyncData(pluginSettings *OnCallPluginSettings) (*OnCallSync, error) { | ||
var err error | ||
|
||
startGetSyncData := time.Now() | ||
defer func() { | ||
elapsed := time.Since(startGetSyncData) | ||
log.DefaultLogger.Info("GetSyncData", "time", elapsed.Milliseconds()) | ||
}() | ||
|
||
onCallPluginSettings, err := a.OnCallSettingsFromContext(ctx) | ||
if err != nil { | ||
return nil, fmt.Errorf("error getting settings from context = %v", err) | ||
} | ||
Comment on lines
-327
to
-330
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to do: onCallPluginSettings, err := a.OnCallSettingsFromContext(ctx) when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see your point. At a quick glance, it seems the passed value is already being got from the context every time? I think the original idea was to sync settings from context with previously saved settings, in case there were any changes. Maybe @mderynck can confirm. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 good cleanup to make. This parameter+call was leftover from when there was some back and forth about what was coming from where. |
||
|
||
onCallSync := OnCallSync{ | ||
Settings: *settings, | ||
Settings: *pluginSettings, | ||
} | ||
onCallSync.Users, err = a.GetAllUsersWithPermissions(onCallPluginSettings) | ||
onCallSync.Users, err = a.GetAllUsersWithPermissions(pluginSettings) | ||
if err != nil { | ||
return nil, fmt.Errorf("error getting users = %v", err) | ||
} | ||
|
||
onCallSync.Teams, err = a.GetAllTeams(onCallPluginSettings) | ||
onCallSync.Teams, err = a.GetAllTeams(pluginSettings) | ||
if err != nil { | ||
return nil, fmt.Errorf("error getting teams = %v", err) | ||
} | ||
|
||
teamMembers, err := a.GetAllTeamMembers(onCallPluginSettings, onCallSync.Teams) | ||
teamMembers, err := a.GetAllTeamMembers(pluginSettings, onCallSync.Teams) | ||
if err != nil { | ||
return nil, fmt.Errorf("error getting team members = %v", err) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IRM won't need to route to
/plugin/install
(it has it's own install handler)