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

Readme/Functionality Discrepancy #4

Open
skoskie opened this issue Mar 4, 2018 · 0 comments
Open

Readme/Functionality Discrepancy #4

skoskie opened this issue Mar 4, 2018 · 0 comments

Comments

@skoskie
Copy link

skoskie commented Mar 4, 2018

Just a quick note: As of v1.4.0, setting the URL is not an optional step.

I assume you default to the gitlab.com endpoint, which is what I am using, but this fails to fetch the projects. And yes, I gave the background process plenty of time to run. It only needed to fetch 4 projects.

Manually setting the URL to https://gitlab.com with or without the trailing slash also fails.

Setting the full path, "api_url": "https://gitlab.com/api/v4/projects", succeeds, returning the projects nearly instantly.


It seems like you already have the correct default ...

api_url = wf.settings.get('api_url', 'https://gitlab.com/api/v4/projects')

However, the initial value of the api_url key in settings.json is an empty string. I wonder if this is preventing the default value from being used.

I should note that I completely uninstalled the workflow and reinstalled it. I then turned on logging before ever invoking the workflow. Through it all, there is no line containing the phrase Setting API URL, as found here:

log.info("Setting API URL to {url}".format(url=args.apiurl))

So I am fairly certain I never set the value to an empty string myself. I ended up setting the correct value directly in settings.json directly.


A URL sanity check might help. There is some great regex here: https://stackoverflow.com/a/7160778/338464

regex = re.compile(
        r'^(?:http)s?://' # http:// or https://
        r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
        r'localhost|' #localhost...
        r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
        r'(?::\d+)?' # optional port
        r'(?:/?|[/?]\S+)$', re.IGNORECASE)

Anyway, thanks for the excellent workflow and the work you have done on it.

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

No branches or pull requests

1 participant