Allow setting AutoStale configuration in configuration instead of just repo-wide
Currently it looks like the only place to adjust the StaleMessage
, StaleLabel
and the other properties is by placing a .gitlab/aports-qa-bot.json
file into each of the managed repositories.
Since this message and labels don't differ between repositories for the usage at postmarketOS, it would be great if we could set the message and label etc in the conf.override.json
file so we don't need to place a .json file into each of the 30+ monitored repositories.
Currently the default message from Services/AutoStale/definition.go
is sent.
For reference, at least making these values into a configuration option would be great:
diff --git a/Services/AutoStale/definition.go b/Services/AutoStale/definition.go
index 61efa90..5e1d57c 100644
--- a/Services/AutoStale/definition.go
+++ b/Services/AutoStale/definition.go
@@ -42,10 +42,10 @@ func (s *Service) getConfigForPid(pid int, log *zerolog.Logger) (RepoConfig, err
Msg("getting project configuration.Configuration")
config := RepoConfig{
- NotStaleLabels: []string{"status:mr-hold"},
+ NotStaleLabels: []string{"status::mr-hold"},
StaleDays: 30,
- StaleLabel: "status:mr-stale",
- StaleMessage: "Sorry to bother you @%s,\n\nbut we've detected that this merge request hasn't seen any recent activity. If you need help or want to discuss your approach with developers you can ping `@%s`. You can also ask on IRC on `#alpine-devel` on Freenode.net. If no further activity occurs in this MR, Alpine developers may close it in the future.\n\nThanks for your contribution.",
+ StaleLabel: "status::mr-stale",
+ StaleMessage: "Sorry to bother you @%s,\n\nbut we've detected that this merge request hasn't seen any recent activity. If you need help or want to discuss your approach with developers you can ping `@%s`. You can also ask on matrix in #devel:postmarketos.org or #postmarketos-devel on OFTC. If no further activity occurs in this MR, postmarketOS developers may close it in the future.\n\nThanks for your contribution.",
}
cfgFile, _, err := s.gitlabClient.RepositoryFiles.GetFile(
@@ -125,7 +125,7 @@ func (s Service) Process(pid int, log *zerolog.Logger) {
if mr.Assignee != nil {
assignee = mr.Assignee.Username
} else {
- assignee = "team/mentors"
+ assignee = "postmarketOS"
}
log := sLog.With().Int("MR", mr.IID).Logger()