Skip to content

Commit

Permalink
Merge pull request #381 from rcerven/emailid
Browse files Browse the repository at this point in the history
set gitauthor for nudging in github email with the same hardcoded number
  • Loading branch information
rcerven authored Dec 13, 2024
2 parents 92cc8fe + 88b4be7 commit da65d94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions controllers/component_dependency_update_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ var _ = Describe("Component nudge controller", func() {
distributionRepositories := []string{"registry.redhat.com/some-product", "registry.redhat.com/other-product"}
matchPackageNames := []string{buildImageRepository, distributionRepositories[0], distributionRepositories[1]}
registryAliases := map[string]string{distributionRepositories[0]: buildImageRepository, distributionRepositories[1]: buildImageRepository}
labels := []string{"konflux-nudge"}

buildResult := BuildResult{
BuiltImageRepository: buildImageRepository,
Expand Down Expand Up @@ -722,6 +723,7 @@ var _ = Describe("Component nudge controller", func() {
Expect(resultConfig.PackageRules[1].FollowTag).Should(Equal(builtImageTag))
Expect(resultConfig.PackageRules[1].MatchPackageNames).Should(Equal(matchPackageNames))
Expect(resultConfig.RegistryAliases).Should(Equal(registryAliases))
Expect(resultConfig.Labels).Should(Equal(labels))
})
})

Expand Down
5 changes: 4 additions & 1 deletion controllers/renovate_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ type RenovateConfig struct {
ForkProcessing string `json:"forkProcessing"`
Extends []string `json:"extends"`
DependencyDashboard bool `json:"dependencyDashboard"`
Labels []string `json:"labels"`
}

var DisableAllPackageRules = PackageRule{MatchPackagePatterns: []string{"*"}, Enabled: false}
Expand Down Expand Up @@ -275,7 +276,8 @@ func (u ComponentDependenciesUpdater) GetUpdateTargetsGithubApp(ctx context.Cont
ComponentName: component.Name,
GitProvider: gitProvider,
Username: fmt.Sprintf("%s[bot]", slug),
GitAuthor: fmt.Sprintf("%s <%d+%s[bot]@users.noreply.github.com>", slug, githubAppInstallation.ID, slug),
// hardcoding the number because mintmaker has it hardcoded as well, so that way mintmaker will recognize the same author
GitAuthor: fmt.Sprintf("%s <126015336+%s[bot]@users.noreply.github.com>", slug, slug),
Token: githubAppInstallation.Token,
Endpoint: git.BuildAPIEndpoint("github").APIEndpoint("github.com"),
Repositories: repositories,
Expand Down Expand Up @@ -349,6 +351,7 @@ func generateRenovateConfigForNudge(target updateTarget, buildResult *BuildResul
ForkProcessing: "enabled",
Extends: []string{":gitSignOff"},
DependencyDashboard: false,
Labels: []string{"konflux-nudge"},
}

return renovateConfig, nil
Expand Down

0 comments on commit da65d94

Please sign in to comment.