Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

allow underscores on id fields for backward compatibility #549

Merged
merged 3 commits into from
May 30, 2018

Conversation

cianfoley-nearform
Copy link
Contributor

@cianfoley-nearform cianfoley-nearform commented May 30, 2018

underscores now whitelisted in all fields to cater for backward compatibility for teams in particular (as underscores were previously enforced).

Migration script updated with regex to cater for underscore and also validation.js in core updated too for all ids

As team paths only allow underscores and alphanumerics (ltree restriction), we must convert hyphens in ids to underscores in the path. this may cause clashes and undesired behaviour so an extra constraint was added to ensure path is unique in migration script.

a test case was added to ensure the database cannot contain two teams with the same path when ids with hypens and underscores convert to to the same path.

paths will be returned with hypens from a user perspective (for easier use of API when we eventually expose calls that use the path), as our default id separator is hyphen (a bug relating to this was fixed in nested teams)

Updated some formatting in overview, and fixed problems in example.md

@coveralls
Copy link

coveralls commented May 30, 2018

Coverage Status

Coverage increased (+0.02%) to 93.148% when pulling 6686b4f on allow-underscores-in-id-whitelist into 89fe1eb on master.

@cianfoley-nearform cianfoley-nearform merged commit f49d506 into master May 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants