immobiliare / backstage-plugin-gitlab

Backstage plugins to interact with GitLab
Apache License 2.0
116 stars 41 forks source link

Parsing CODEOWNERS file fails if (period) . is in the name/group #595

Closed mbilling closed 1 month ago

mbilling commented 1 month ago

Repro

  1. Have a CODEOWNERS file with content (see below) in you repo where you have a catalog-info.yaml entity
  2. Have a EntityPage.tsx page using
  3. Browse to the entity in backstage
  4. You get following error message: *@my.full.name is not a valid owner name in rule @my.full.name**

CODEOWNERS file content

* @my.full.name

Reason The regex parsing the usern/group names in the CODEOWNERS file are very strict. I don't think this is necessary at all. I doesn't matter what characters is used other than @ and [SPACE} (at least in the comtext of this plugin)

PR Proposal Parse with a much simpler regex And include . as allowed E.g. ^@([a-zA-Z0-9-\/<.]+)(\s@([a-zA-Z0-9-\/.]+))*$

antoniomuso commented 1 month ago

https://github.com/immobiliare/backstage-plugin-gitlab/pull/597

mbilling commented 1 month ago

Great, thanks for the fix Much appreciated!