◐ Shell
clean mode source ↗

feat(users): implement 'skip_confirmation' in users 'emails' creation by AdrianDC · Pull Request #3265 · python-gitlab/python-gitlab

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'