Skip to content
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

[BUG] Deployment.FailureEncountered Does Not Populate as Expected (Always False) #295

Open
kurtislamb opened this issue Jan 3, 2025 · 0 comments

Comments

@kurtislamb
Copy link

Description
When calling Deployments.GetDeployment the returned data incorrectly shows FailureEncountered as False even if the deployment indeed failed.

Steps To Reproduce
1.Init a Client
2.Create a projects.Project struct eg octopusProjectData.project in below code
3.Use code below to get all releases for a project then iterate through each release, then iterate through each deployment

releaseInfo, err := client.Projects.GetReleases(octopusProjectData.project)
	if err != nil {
		return latestSuccessfulRelease, fmt.Errorf("failed to lookup Release data: %w", err)
	}

	for _, release := range releaseInfo {
		log.Println("Release Version:", release.Version)
		deployments, err := client.Deployments.GetDeployments(release)
		for _, deployment := range deployments.Items {
                        log.Println(release.Version)
			log.Println(deployment.ID)
			log.Println(deployment.FailureEncountered, "\n")
		}
	}

Expected Behavior
If a deployment for a release has failed, I would expect FailureEncountered to return true, so we can then disregard this deployment.

First 2 should show as True (A Failure was Encountered)

2025/01/03 08:46:45 KL-2025.0.3
2025/01/03 08:46:45 Deployments-1478
2025/01/03 08:46:45 true

2025/01/03 08:46:45 KL-2025.0.2
2025/01/03 08:46:45 Deployments-1477
2025/01/03 08:46:45 true

2025/01/03 08:46:45 KL-2025.0.1
2025/01/03 08:46:45 Deployments-1474
2025/01/03 08:46:45 false 

Any Logs and/or Other Supporting Information

Output From Octopus Deploy, I would expect .0.3 and .0.2 to return as failed
image

Output from GO

2025/01/03 08:46:45 KL-2025.0.3
2025/01/03 08:46:45 Deployments-1478
2025/01/03 08:46:45 false 

2025/01/03 08:46:45 KL-2025.0.2
2025/01/03 08:46:45 Deployments-1477
2025/01/03 08:46:45 false 

2025/01/03 08:46:45 KL-2025.0.1
2025/01/03 08:46:45 Deployments-1474
2025/01/03 08:46:45 false 

Environment and/or Versions

  • Octopus Server Version: Octopus 2025.1 - Cloud
  • Go Version: go1.23.0 linux/amd64

Additional Context
The approach of the above code is to find the last Deployment for a Project, iterating through releases and their deployments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant