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

fix: --auth when --git-user contains space #95

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

peat-psuwit
Copy link
Contributor

Since --git-user is a user-facing name, it's common to include a space in it. As such, it's not suitable to use as a username in a Git remote URL.

GitLab documented that it doesn't (yet?) check for username [1], and from my testing GitHub doesn't seem to care either. So just use an arbitrary name as a username.

[1] https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

Thank you for submitting this pull request

Checklist

  • Tests added if applicable.
  • Documentation updated if applicable.

Note: dist/cli/index.js and dist/gha/index.js are automatically generated by git hooks and gh workflows.

First time here?

This project follows git conventional commits pattern, therefore the commits should have the following format:

<type>(<optional scope>): <subject>
empty separator line
<optional body>
empty separator line
<optional footer>

Where the type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]

NOTE: if you are still in a work in progress branch and you want to push your changes remotely, consider adding --no-verify for both commit and push, e.g., git push origin <feat-branch> --no-verify - this could become useful to push changes where there are still tests failures. Once the pull request is ready, please amend the commit and force-push it to keep following the adopted git commit standard.

How to prepare for a new release?

There is no need to manually update package.json version and CHANGELOG.md information. This process has been automated in Prepare Release Github workflow.

Therefore whenever enough changes are merged into the main branch, one of the maintainers will trigger this workflow that will automatically update version and changelog based on the commits on the git tree.

More details can be found in package release section of the README.

Since --git-user is a user-facing name, it's common to include a space
in it. As such, it's not suitable to use as a username in a Git remote
URL.

GitLab documented that it doesn't (yet?) check for username [1], and
from my testing GitHub doesn't seem to care either. So just use an
arbitrary name as a username.

[1] https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
91.13% (+0.87% 🔼)
421/462
🟢 Branches
84.69% (+1.87% 🔼)
166/196
🟢 Functions
89.83% (+0.85% 🔼)
106/118
🟢 Lines
91.11% (+0.89% 🔼)
410/450

Test suite run success

168 tests passing in 16 suites.

Report generated by 🧪jest coverage report action from 56531a5

@lampajr lampajr self-requested a review February 22, 2024 13:11
Copy link
Member

@lampajr lampajr left a comment

Choose a reason for hiding this comment

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

Hu @peat-psuwit, really great catch!!!
Looks like I've never had to set the git user with space in the past 😆 (at least not with this tool).

Therefore the change looks great!
I tested also locally and it is working as expected, for now I think that keeping a generic token word as username with // Anything will work as a username. as comment is fair enough!

If we need to make it configurable in the future we can simply do it by adding an additional parameter 😃

@lampajr lampajr merged commit 9bcd6e6 into kiegroup:main Feb 23, 2024
4 checks passed
@lampajr
Copy link
Member

lampajr commented Feb 23, 2024

Thanks again for you contribution @peat-psuwit ❤️

@peat-psuwit peat-psuwit deleted the fix-auth-user-have-space branch October 3, 2024 17:31
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

Successfully merging this pull request may close these issues.

2 participants