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

deployEnvironmentX mutations don't always report errors correctly #2762

Closed
shreddedbacon opened this issue Jul 12, 2021 · 2 comments
Closed
Labels
1-api-auth API & Authentication subsystem

Comments

@shreddedbacon
Copy link
Member

Describe the bug

When running a deployEnvironmentX mutation, if any errors are encountered it doesn't always respond with an actual API error, just a string representation of an error.

Example:

# first update a project to use an invalid build system
mutation updateProject {
  updateProject(input: {
    id: 32, 
    patch: {
      activeSystemsDeploy: "lagoon_kubernetesBuildDeploy"
    }
  }) {
    standbyRoutes
  }
}
# then deploy the latest of an environment within that project
mutation deployLatest {
    deployEnvironmentLatest(input: {
      environment: {
        id:14
      }
    }
  )
}
{
  "data": {
    "deployEnvironmentLatest": "Error: Unknown active system 'lagoon_kubernetesBuildDeploy' for task 'deploy' in for project ci-features-control-k8s"
  }
}

Running the same against an environment/project that has no access, we get an actual error from the API.

{
  "errors": [
    {
      "message": "Unauthorized",
      "locations": [
        {
          "line": 1412,
          "column": 5
        }
      ],
      "path": [
        "deployEnvironmentLatest"
      ]
    }
  ],
  "data": {
    "deployEnvironmentLatest": null
  }
}

Additional context

This was reported against the CLI, but the actual issue exists in the API (CLI has a possible workaround)
uselagoon/lagoon-cli#189

@shreddedbacon shreddedbacon added the 1-api-auth API & Authentication subsystem label Jul 12, 2021
@tobybellwood
Copy link
Member

Unsuccessful operations should at least return unsuccessfully - what is returned is the subject of heated b/c conversations!

@shreddedbacon
Copy link
Member Author

resolved in #3568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-api-auth API & Authentication subsystem
Projects
None yet
Development

No branches or pull requests

2 participants