diff --git a/server/events/status/cleaner.go b/server/events/status/cleaner.go index d0b61564e..8f082dc39 100644 --- a/server/events/status/cleaner.go +++ b/server/events/status/cleaner.go @@ -108,10 +108,3 @@ func (h *StatusCleanupHelper) CleanupAfterSilence(ctx *command.Context, reason s return h.Cleaner.ClearAllStatuses(ctx) } -// CleanupPendingOnly clears only pending statuses, leaving success/failure statuses intact -func (h *StatusCleanupHelper) CleanupPendingOnly(ctx *command.Context, commands []command.Name) error { - ctx.Log.Debug("cleaning up pending statuses only") - // This would require querying current status first (future enhancement) - // For now, just clear all specified commands - return h.Cleaner.ClearPendingStatuses(ctx, commands) -} \ No newline at end of file diff --git a/server/events/status/manager.go b/server/events/status/manager.go index 7948c6eb4..a3dedd1a9 100644 --- a/server/events/status/manager.go +++ b/server/events/status/manager.go @@ -1,6 +1,8 @@ package status import ( + "errors" + "github.com/runatlantis/atlantis/server/events/command" "github.com/runatlantis/atlantis/server/events/models" "github.com/runatlantis/atlantis/server/logging" @@ -100,10 +102,13 @@ func (s *DefaultStatusManager) ClearStatusForCommand(ctx *command.Context, cmdNa return s.CommitStatusUpdater.UpdateCombinedCount(ctx.Log, ctx.Pull.BaseRepo, ctx.Pull, models.SuccessCommitStatus, cmdName, 0, 0) } -// GetCurrentStatus returns the current status state (placeholder for future) +// GetCurrentStatus returns the current status state from VCS +// This would be used for status reconciliation and avoiding duplicate updates func (s *DefaultStatusManager) GetCurrentStatus(repo models.Repo, pull models.PullRequest) (*StatusState, error) { - // TODO: Implement status querying from VCS - return nil, nil + // TODO: Query actual status from VCS provider (GitHub/GitLab/etc) + // This should return current pending/success/failure state for each command type + // Implementation would depend on VCS provider and might use existing VCS client + return nil, errors.New("GetCurrentStatus not implemented - status querying from VCS not yet supported") } // executeDecision executes a status decision diff --git a/server/events/status/policy.go b/server/events/status/policy.go index 6b8a760b7..0c166fbaf 100644 --- a/server/events/status/policy.go +++ b/server/events/status/policy.go @@ -148,10 +148,11 @@ func (p *SilencePolicy) DecideOnNoProjects(ctx *command.Context, cmdName command // shouldSilenceForkPR checks if this is a fork PR that should be silenced func (p *SilencePolicy) shouldSilenceForkPR(ctx *command.Context) bool { - // TODO: Need to determine if this is a fork PR - // For now, return false as we don't have access to fork detection logic - // This would need to be passed in or determined from context - return false + // A fork PR is when head repo owner != base repo owner + isForkPR := ctx.HeadRepo.Owner != ctx.Pull.BaseRepo.Owner + + // We silence if it's a fork PR and SilenceForkPRErrors is enabled + return isForkPR && p.SilenceForkPRErrors } // shouldSilenceNoProjects checks if we should silence when no projects are found