Skip to content

Conversation

@AdrianDC
Copy link
Contributor

Changes

Documentation and testing

Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:

  • Documentation automatically generated and new key matches admins sources
  • No test added as most other settings are not implemented in tests/functional/cli/test_cli_v4.py

@AdrianDC
Copy link
Contributor Author

AdrianDC commented Sep 21, 2025

Tested working properly to add + confirm an email for a GitLab bot user using noreply secondary email address.


For reference to manually patch older sources in CI/CD jobs,
using the registry.gitlab.com/python-gitlab/python-gitlab:latest image :

    # Patch GitLab sources
    - |
      gitlab_bin=$(which gitlab | xargs readlink -f)
      gitlab_venv="${gitlab_bin%/bin/*}"
      gitlab_users=$(ls -1 "${gitlab_venv}/lib/python"*/*-packages/gitlab/v4/objects/users.py || true)
      if ! grep -q ', "skip_confirmation", ' "${gitlab_users}"; then
        sed -i 's/\("email"\),)/\1, "skip_confirmation", )/g' "${gitlab_users}"
      fi

For self usage upon future PR, to run codestyle tasks from containers :

docker run \
    -v "${PWD}:${PWD}:rw" \
    -w "${PWD}" \
    --entrypoint 'sh' \
    --rm \
    'alpine:3' \
    -c \
    'apk add py3-tox && tox -e black,isort'

Signed-off-by: Adrian DC <radian.dc@gmail.com>
@JohnVillalovos JohnVillalovos force-pushed the users-create-withoutconfirmation branch from 9462342 to c7dc968 Compare October 17, 2025 16:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Implements support for the skip_confirmation parameter when creating user email addresses via the UserEmailManager, aligning with the GitLab API.

  • Add skip_confirmation as an optional attribute to UserEmailManager._create_attrs
  • Minor formatting change to multi-line RequiredOptional definition

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@JohnVillalovos JohnVillalovos left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @AdrianDC

@JohnVillalovos JohnVillalovos enabled auto-merge (rebase) October 17, 2025 16:18
@JohnVillalovos JohnVillalovos merged commit 2981730 into python-gitlab:main Oct 17, 2025
17 checks passed
@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.32%. Comparing base (3859aa0) to head (c7dc968).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3265   +/-   ##
=======================================
  Coverage   97.32%   97.32%           
=======================================
  Files          98       98           
  Lines        6052     6052           
=======================================
  Hits         5890     5890           
  Misses        162      162           
Flag Coverage Δ
api_func_v4 83.69% <100.00%> (+0.16%) ⬆️
cli_func_v4 84.64% <100.00%> (ø)
unit 90.18% <100.00%> (ø)

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

Files with missing lines Coverage Δ
gitlab/v4/objects/users.py 99.20% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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