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

[Bug]: Inconsistency between org field validation in CLI and central #39723

Open
gayaldassanayake opened this issue Feb 24, 2023 · 3 comments
Open
Assignees
Labels
Area/CLI-BuildTools Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug

Comments

@gayaldassanayake
Copy link
Contributor

Description

According to ballerina central, "Organization name can only contain alphanumeric values with lower case letters and cannot start with numeric values".

However ballerina toml org field validation regex is ^[a-zA-Z0-9_]*$, which allows any string consisting of zero or more alphanumeric characters or underscores. Note that both upper and lower cases are allowed.

Similarly in the CLI commands (eg- pull), we have a validation identical to the toml validation in ProjectUtils.validateOrgName method.

This can be an issue since the user will not realize that the org name is incompatible with the central validation until he tries to create an org in the central with the same org name as the repo.

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Other Area

Related issue(s) (optional)

#39721

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@gayaldassanayake gayaldassanayake added Type/Bug Area/CLI Ballerina CLI related issues. Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) labels Feb 24, 2023
@azinneera azinneera added Area/CLI-BuildTools and removed Area/CLI Ballerina CLI related issues. labels Mar 13, 2023
@ShammiL ShammiL self-assigned this Nov 21, 2023
@ShammiL
Copy link
Contributor

ShammiL commented Nov 21, 2023

Following https://github.com/ballerina-platform/ballerina-spec/issues/791#issuecomment-858593020, the following validations were done in Ballerina.toml.

  • ASCII only
  • alphanumeric + underscore only
  • no initial underscore
  • no trailing underscore
  • no consecutive underscores
  • max length 256 chars

The same validations should also be enabled on Central. This improvement is tracked in https://github.com/wso2-enterprise/ballerina-registry/issues/1201

@ShammiL ShammiL closed this as completed Nov 21, 2023
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@Thevakumar-Luheerathan
Copy link
Member

This issue can not addressed from the Central side because of org name limitation in Asgardeo. Currently, we are having an issue when we create new packages with templates and publish them. Here, the org name is derived from the OS user account(user account name can have space. These spaces are replaced with an underscore.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/CLI-BuildTools Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug
Projects
Status: BackLog
Development

No branches or pull requests

4 participants