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

Add coverage for UnreservedUsernameValidator #25590

Merged

Conversation

mjankowski
Copy link
Contributor

The code path in the PAM/Rpam2 case was previously not exercised in the suite. While in there, I did some lightweight method-rename refactor on the validator itself. As far as I can tell the behavior is the same, and coverage is now 100%.

@mjankowski mjankowski force-pushed the spec-validators-unreserved-username branch from b73182a to c2f373a Compare June 26, 2023 18:09
@mjankowski
Copy link
Contributor Author

I don't see that CI failure locally and can't replicate with a few runs and modifications of things ... will keep attempting.

@renchap renchap added testing Automated lint and test suites ruby Pull requests that update Ruby code labels Jun 26, 2023
@nschonni
Copy link
Contributor

Only guess is that it's related to the environment variables set here

ALLOW_NOPAM: true
PAM_ENABLED: true
PAM_DEFAULT_SERVICE: pam_test
PAM_CONTROLLED_SERVICE: pam_test_controlled
BUNDLE_WITH: 'pam_authentication test'

Those came from CircleCI, and I never got a separate PAM-only job working when I tried before

@mjankowski
Copy link
Contributor Author

Ah, thanks! -- it is indeed something in that block. When I set those all locally I'm able to replicate the failure.

I'll sort through that and see what's happening.

@renchap
Copy link
Sponsor Member

renchap commented Jun 26, 2023

Can you use climate_control to set those variables in your spec?

@mjankowski mjankowski force-pushed the spec-validators-unreserved-username branch from c2f373a to d206aaf Compare June 26, 2023 21:32
@mjankowski
Copy link
Contributor Author

Can you use climate_control to set those variables in your spec?

Some of them are related to what gems are loaded in the first place or what happens at initialization time of the whole app, and can't (or at least not as straightforwardly) be handled that way ... others, yes maybe.

@mjankowski
Copy link
Contributor Author

Just pushed a change which I think may resolve things.

In my initial PR I had (erroneously!) changed the original code away from what it was doing before, which was that even if/when PAM was enabled, to still always check the reserved usernames in the settings. My initial PR changed this to either check the PAM settings or the site settings, but not both, which would have been a regression and I'm glad that CI run caught it.

I pushed something which restores the original behavior which is to let either pam OR the site settings flag a reserved name. Will watch CI to confirm that was the issue.

@ClearlyClaire ClearlyClaire merged commit 19900f6 into mastodon:main Oct 17, 2023
26 checks passed
@mjankowski mjankowski deleted the spec-validators-unreserved-username branch October 17, 2023 12:58
audiodude pushed a commit to audiodude/mastodon that referenced this pull request Oct 23, 2023
000hen pushed a commit to thenapnetwork/nap-mastodon that referenced this pull request Dec 6, 2023
vmstan pushed a commit to vmstan/mastodon that referenced this pull request Dec 14, 2023
vmstan pushed a commit to vmstan/mastodon that referenced this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code testing Automated lint and test suites
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants