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][Github] Successful deployments don't set "SUCCESS" result / "DONE" status in cicd_deployments table #6869

Closed
3 tasks done
eschumm751 opened this issue Jan 25, 2024 · 1 comment · Fixed by #6873
Closed
3 tasks done
Labels
type/bug This issue is a bug

Comments

@eschumm751
Copy link

eschumm751 commented Jan 25, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

deployments downloaded via the github connector only show a FAILURE result. Successful deployments have no result set in the cicd_deployments table (or DORA validation dashboard) and have OTHER set as

What do you expect to happen

Successful deployments should set result to SUCCESS and status DONE to generate deployments for DORA dashboards.

How to reproduce

Configure a github connector as part of a project with successful and failed deployements. ingest the logs. View the DORA validation dashboard or the underlying mysql database.

Anything else

Hello,

I am trying to get deployments to parse from gitops, but it appears that the converter is not parsing successful deployments properly. The cicd_deployments table's result column only contains values in the result column for failures. This seems to be because the converter code here is looking at the State member, which doesn't actually contain "SUCCESS" for a successful deployment, from the data I am seeing from calls to our github.com repository. We are creating these deployments via api from our pipeline setting status to "failure" or "success". (I'm running v.0.20.0-beta8)

Pulling deployments from the raw_github_graphql_deployment table seems to point out a flaw in this logic, at least for my data: Success is set on LastStatus only if it is the active deployment, so failed deployments will only be populated.

Failed deployment:

                {
                    "Task": "deploy",
                    "Id": "DE_kwDOJViRD85JhakS",
                    "CommitOid": "2dd81bcbec927df94153fd23b7a7935491e5feda",
                    "Environment": "production",
                    "State": "FAILURE",
                    "DatabaseId": 1233496338,
                    "Description": "Deploy 0.0.18 to production",
                    "Payload": "",
                    "Ref": null,
                    "LatestStatus": {
                        "Id": "DES_kwDOJViRD86vyS6U",
                        "State": "FAILURE",
                        "updatedAt": "2023-12-20T00:26:09Z"
                    },
                    "Repository": {
                        "Id": "R_kgDOJViRDw",
                        "Name": "bar",
                        "Url": "https://github.com/XXX/bar"
                    },
                    "CreatedAt": "2023-12-20T00:26:09Z",
                    "UpdatedAt": "2023-12-20T00:26:09Z"
                },

Successful Deployment (inactive):

{
                    "Task": "deploy",
                    "Id": "DE_kwDOKMiVkc5MmKAA",
                    "CommitOid": "8158e2000c44f9cf54640a962d178dc98e6755af",
                    "Environment": "production",
                    "State": "INACTIVE",
                    "DatabaseId": 1285070848,
                    "Description": "Deploy 0.0.17 to production",
                    "Payload": "",
                    "Ref": null,
                    "LatestStatus": {
                        "Id": "DES_kwDOKMiVkc64xqtd",
                        "State": "INACTIVE",
                        "updatedAt": "2024-01-22T21:06:22Z"
                    },
                    "Repository": {
                        "Id": "R_kgDOKMiVkQ",
                        "Name": "foo",
                        "Url": "https://github.com/XXX/foo"
                    },
                    "CreatedAt": "2024-01-22T19:06:32Z",
                    "UpdatedAt": "2024-01-22T21:06:22Z"
                },

Successful Deployment (if it is currently active):

{
                    "Task": "deploy",
                    "Id": "DE_kwDOKMiVkc5Mm_x7",
                    "CommitOid": "7cf924eb079bee9e9578eab72229de2dde72517b",
                    "Environment": "production",
                    "State": "ACTIVE",
                    "DatabaseId": 1285291131,
                    "Description": "Deploy 0.0.18 to production",
                    "Payload": "",
                    "Ref": null,
                    "LatestStatus": {
                        "Id": "DES_kwDOKMiVkc64xqsx",
                        "State": "SUCCESS",
                        "updatedAt": "2024-01-22T21:06:22Z"
                    },
                    "Repository": {
                        "Id": "R_kgDOKMiVkQ",
                        "Name": "foo",
                        "Url": "https://github.com/XXX/foo"
                    },
                    "CreatedAt": "2024-01-22T21:06:21Z",
                    "UpdatedAt": "2024-01-22T21:06:22Z"
                },

I think that the logic should be success = (State == "ACTIVE" && LatestStatus.State == "SUCCESS") || (State == "INACTIVE" && Latest.State == "INACTIVE")

Looking at the source code, it appears that it is expecting different behavior from the api than I see captured in my tables.

Link to question in slack

Version

v.0.20.0-beta8

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@klesh
Copy link
Contributor

klesh commented Jan 26, 2024

Fixed in v0.20-rc2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug This issue is a bug
Projects
None yet
2 participants