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

(SDK-290) Make sure that all usernames are processed when creating a new module #108

Merged
merged 4 commits into from
Jun 27, 2017

Conversation

austb
Copy link
Contributor

@austb austb commented Jun 27, 2017

No description provided.

@rodjek
Copy link
Contributor

rodjek commented Jun 27, 2017

Long term, I think we'll want to save the answers to the interview questions (where they're not specific to the module) into a file and read those in as the default values, so that users only have to provide forge username, preferred license etc once. For now though, I think aborting and asking the user to run without --skip-interview is a good way to go.

Copy link
Contributor

@DavidS DavidS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An answer file will provide some relief for this. Talking about this also highlights that --skip-interview will be the default for many people (If not for everyone, after their first new module run). Aborting on skip-interview therefore would break the workflow for a majority of the people.

Please change the raise to coerce, and log instead.

@DavidS
Copy link
Contributor

DavidS commented Jun 27, 2017

I've added some pending unit tests that show the behaviour I'd like to see.

The failing acceptance tests are from a hidden merge conflict to master. Please rebase this, and address those issues.


username = ''
username = Etc.getlogin.gsub(%r{[^0-9a-z]}i, '')
username = 'username' if username == ''
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This protects against an entirely non-alphanumeric username

@austb austb changed the title {WIP} (SDK-292) A 'safe' fix to the username problem (SDK-290) A 'safe' fix to the username problem Jun 27, 2017
@DavidS DavidS changed the title (SDK-290) A 'safe' fix to the username problem (SDK-290) Make sure that all usernames are processed when creating a new module Jun 27, 2017
@DavidS DavidS added the feature label Jun 27, 2017
@DavidS DavidS merged commit dc6aae5 into puppetlabs:master Jun 27, 2017
@DavidS DavidS added bug and removed feature labels Jun 28, 2017
@austb austb deleted the sdk-292 branch July 26, 2017 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants