apigee / apigee/devrel

Update developer Keys error when they already exists

Open
#764 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
221
Forks
174
PR merge metrics
No merged PRs in 30d

Description

I noticed that in sackmesser deploy when we do incremental deploy of the configs folder. ApiProducts, developers, and developerApps that already exists gets updated, but, if the key already exists it throws an error and stop the whole deployment.

Is this an expected behavior or should it be similar to the other resources? if it's expected, Is there a feature to bypass these error and keep the deployment? Do you think it makes sense to add this feature?

My goal is to be able to do incremental migrations with the sackmesser deploy command from apigee edge to apigee X.

Example

 **************************
POST  https://url/v1/organizations/apigee-org/developers/developerEmail/apps/appname/keys/create
accept-encoding: [gzip]
authorization: [Bearer [Not shown in log]
x-goog-api-format-version: 2
content-type: application/json
 [Request body]
{"consumerKey":"Key","consumerSecret":"secret"}
Apigee call failed 409 Conflict
{
  "error": {
    "code": 409,
    "message": "ConsumerKey already exists",
    "status": "ABORTED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.PreconditionFailure",
        "violations": [
          {
            "type": "keymanagement.service.ConsumerKeyAlreadyExists",
            "subject": "[2002:a05:6148:86a1:b0:578:9331:5126]:4001:uycjd5-20020a0574147d0500b0004b11ec048b:9801:943860:291277",
            "description": "ConsumerKey already exists"
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.rpc.RequestInfo",
        "requestId": "7850316936529017734"
      }
    ]
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sackmesser deploy incremental migration for the configs folder and inspect the developer app key creation request shown in the issue. Clarify whether existing consumer keys should be skipped or updated, and define done as a migration that handles already-existing keys without stopping the deployment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.