Skip to content

Commit b919c64

Browse files
committed
add debugging comment
1 parent bedd616 commit b919c64

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ COPY . .
2727
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
2828
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
2929
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
30-
RUN \
31-
go test -v -cover ./... && \
32-
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o tf-applier
30+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o tf-applier
3331

3432
FROM alpine:3.23
3533

prplanner/msg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func parseRequestAcknowledgedMsg(commentBody string) (cluster string, module typ
136136
return meta.Cluster, parseNamespaceName(meta.Module), meta.Path, meta.CommitID, ReqAt
137137
}
138138

139-
func parseRunOutputMsg(comment string) (cluster string, module types.NamespacedName, path string, commit string) {
139+
func ParseRunOutputMsg(comment string) (cluster string, module types.NamespacedName, path string, commit string) {
140140
meta := extractMetadata(comment)
141141
if meta == nil || meta.Type != MsgTypeRunOutput {
142142
return

prplanner/msg_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func Test_parseRunOutputMsg(t *testing.T) {
432432
}
433433
for _, tt := range tests {
434434
t.Run(tt.name, func(t *testing.T) {
435-
gotCluster, gotModule, gotPath, gotCommit := parseRunOutputMsg(tt.args.comment)
435+
gotCluster, gotModule, gotPath, gotCommit := ParseRunOutputMsg(tt.args.comment)
436436
if !reflect.DeepEqual(gotCluster, tt.wantCluster) {
437437
t.Errorf("parseRunOutputMsg() gotCluster = %v, want %v", gotCluster, tt.wantCluster)
438438
}

prplanner/requests.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ func (p *Planner) checkPRCommits(ctx context.Context, pr *pr, commitsInfo []repo
8181
return nil, nil
8282
}
8383

84+
fmt.Println(p.ClusterEnvName, pr, commit.Hash, module.Spec.Path, module.NamespacedName())
85+
8486
// request run
8587
p.Log.Info("triggering plan due to new commit", "module", module.NamespacedName(), "pr", pr.Number, "author", pr.Author.Login)
8688
return p.addNewRequest(module, pr, commit.Hash)
@@ -104,7 +106,7 @@ func (p *Planner) checkPRCommentsForPlanRequests(pr *pr, module *tfaplv1beta1.Mo
104106
}
105107

106108
// Skip if terraform plan output is already posted
107-
commentCluster, commentModule, commentPath, _ = parseRunOutputMsg(comment.Body)
109+
commentCluster, commentModule, commentPath, _ = ParseRunOutputMsg(comment.Body)
108110
if commentCluster == p.ClusterEnvName &&
109111
commentModule == module.NamespacedName() &&
110112
commentPath == module.Spec.Path {
@@ -139,7 +141,7 @@ func isPlanOutputPostedForCommit(cluster string, pr *pr, commitID, modulePath st
139141
for i := len(pr.Comments.Nodes) - 1; i >= 0; i-- {
140142
comment := pr.Comments.Nodes[i]
141143

142-
commentCluster, commentModule, commentPath, commentCommitID := parseRunOutputMsg(comment.Body)
144+
commentCluster, commentModule, commentPath, commentCommitID := ParseRunOutputMsg(comment.Body)
143145
if commentCluster == cluster && commentModule == module && commentPath == modulePath && commentCommitID == commitID {
144146
return true
145147
}

0 commit comments

Comments
 (0)