Skip to content

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

Merged
woop merged 1 commit into
feast-dev:masterfrom
tedhtchang:validate-repo-name
May 19, 2021
Merged

Validate project and repo names for apply and init commands#1558
woop merged 1 commit into
feast-dev:masterfrom
tedhtchang:validate-repo-name

Conversation

@tedhtchang

Copy link
Copy Markdown
Contributor

Signed-off-by: ted chang htchang@us.ibm.com

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
Copy Markdown
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.

Details

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
Signed-off-by: ted chang <htchang@us.ibm.com>
@tedhtchang
tedhtchang force-pushed the validate-repo-name branch from 1209932 to 5d71932 Compare May 13, 2021 10:16
@woop

woop commented May 19, 2021

Copy link
Copy Markdown
Member

/lgtm

@feast-ci-bot

Copy link
Copy Markdown
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

Details 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

codecov-commenter commented May 19, 2021

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@77a7975). Learn more about missing BASE report.

Files with missing lines Patch % Lines
sdk/python/feast/repo_operations.py 33.33% 6 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1558   +/-   ##
=========================================
  Coverage          ?   83.42%           
=========================================
  Files             ?       65           
  Lines             ?     5653           
  Branches          ?        0           
=========================================
  Hits              ?     4716           
  Misses            ?      937           
  Partials          ?        0           
Flag Coverage Δ
integrationtests 83.42% <33.33%> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@woop
woop merged commit 3017dd4 into feast-dev:master May 19, 2021
woop pushed a commit that referenced this pull request May 19, 2021
Signed-off-by: ted chang <htchang@us.ibm.com>
@dmatrix

dmatrix commented May 28, 2021

Copy link
Copy Markdown
Contributor

@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

woop commented May 28, 2021

Copy link
Copy Markdown
Member

@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
Copy Markdown
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