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

Validate project and repo names for apply and init commands #1558

Merged
merged 1 commit into from
May 19, 2021

Conversation

tedhtchang
Copy link
Contributor

Signed-off-by: ted chang [email protected]

Validate project and project directory names contain only alphanumerical values and underscores.
Fixes #1545

Does this PR introduce a user-facing change?:

Validate project and repository names for apply and init commands

@feast-ci-bot
Copy link
Collaborator

Hi @tedhtchang. Thanks for your PR.

I'm waiting for a feast-dev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tedhtchang tedhtchang changed the title validate project and repo names for apply and init commands Validate project and repo names for apply and init commands May 13, 2021
@woop
Copy link
Member

woop commented May 19, 2021

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tedhtchang, woop

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov-commenter
Copy link

codecov-commenter commented May 19, 2021

Codecov Report

❗ No coverage uploaded for pull request base (master@77a7975). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1558   +/-   ##
=========================================
  Coverage          ?   83.42%           
=========================================
  Files             ?       65           
  Lines             ?     5653           
  Branches          ?        0           
=========================================
  Hits              ?     4716           
  Misses            ?      937           
  Partials          ?        0           
Flag Coverage Δ
integrationtests 83.42% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77a7975...5d71932. Read the comment docs.

@woop woop merged commit 3017dd4 into feast-dev:master May 19, 2021
woop pushed a commit that referenced this pull request May 19, 2021
@dmatrix
Copy link
Contributor

dmatrix commented May 28, 2021

@tedhtchang @woop
Would it make sense to make it airtight by ensuring that no names start with "_<table_name>" as SQLite, I believe, disallows _sqlite_table_name or _table_name. WDYT?

(And a minor nit: Python style suggests that boolean functions
conventionally are isdigit() isalpha(), islower() etc. Should this be renamed as is_valid_name() ? ) Up to you guys. :-)

def not_valid_name(name: str) -> bool:    
"""Test project or repo names. True if names have characters other than alphanumeric values and underscores"""    return 
     return name.startswith("_") or re.compile(r"\W+").search(name) is not None

@woop
Copy link
Member

woop commented May 28, 2021

@tedhtchang @woop
Would it make sense to make it airtight by ensuring that no names start with "_<table_name>" as SQLite, I believe, disallows _sqlite_table_name or _table_name. WDYT?

(And a minor nit: Python style suggests that boolean functions
conventionally are isdigit() isalpha(), islower() etc. Should this be renamed as is_valid_name() ? ) Up to you guys. :-)

def not_valid_name(name: str) -> bool:    
"""Test project or repo names. True if names have characters other than alphanumeric values and underscores"""    return 
     return name.startswith("_") or re.compile(r"\W+").search(name) is not None

Yea, both suggestions make sense to me

@tedhtchang
Copy link
Contributor Author

@woop @dmatrix i will work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure when there is a hyphen in project names
5 participants