cloudfoundry / cloudfoundry/cloud_controller_ng

Errors v2.yml contains duplicate keys

Open
#2,894 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

unscheduled v2-only
Dominant language
Ruby
Stars
207
Forks
373
Avg merge
2d 12h
Merged PRs (30d)
56

Description

Issue

errors/v2.yml contains two duplicate keys:

Both of the above are defined twice and with different names and messages in the v2.yml file. The results could vary depending on how the yaml document is unmarshalled.

Context

go-cfclient uses the v2.yml to generate error info

Steps to Reproduce

In go-cfclient attempt to upgrade to gopkg.in/yaml.v3, run make generate

Expected result

The v2.yml document unmarshals fine.

Current result

gen_error.go:49: yaml: unmarshal errors:
  line 221: mapping key "60003" already defined at line 216
  line 1031: mapping key "290013" already defined at line 1021

Possible Fix

Remove the duplicate key keeping only one. Likely for backwards compatibility it would need to be whatever the Ruby yaml parser keeps.

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

Inspect errors/v2.yml at the cited entries for keys 60003 and 290013, then check which duplicate definition the Ruby YAML parser retains for backwards compatibility. Run go-cfclient's make generate command to verify the document unmarshals without duplicate-key errors and each key is defined only once.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, yaml
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.