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

chore(dev/ci): set expiry date for access token #557

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

amimas
Copy link
Collaborator

@amimas amimas commented Jul 11, 2023

As of GitLab v16.0, all access tokens must have an expiry date. Otherwise the access token will not be created. This wasn't being done in the script that sets up a GitLab instances with an access token so that the token can be used for all acceptance tests via API calls. This worked fine before but started failing recently when latest version of GitLab was being used in the CI because the latest version is 16 and up. As a result, all the PR validations are failing because the acceptance tests are failing with '401 Unauthorized' error.

As of GitLab v16.0, all access tokens must have an expiry date. Otherwise the access token will not be created. This wasn't being done in the script that sets up a GitLab instances with an access token so that the token can be used for all acceptance tests via API calls. This worked fine before but started failing recently when latest version of GitLab was being used in the CI because the latest version is 16 and up. As a result, all the PR validations are failing because the acceptance tests are failing with '401 Unauthorized' error.
@amimas amimas requested a review from gdubicki July 11, 2023 14:02
@amimas amimas temporarily deployed to Integrate Pull Request July 11, 2023 14:03 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #557 (09f9d26) into main (24bdac6) will decrease coverage by 15.92%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #557       +/-   ##
===========================================
- Coverage   82.09%   66.17%   -15.92%     
===========================================
  Files          70       70               
  Lines        2658     2658               
===========================================
- Hits         2182     1759      -423     
- Misses        476      899      +423     

see 37 files with indirect coverage changes

@amimas
Copy link
Collaborator Author

amimas commented Jul 11, 2023

Hi @gdubicki 👋,

I'm not sure why codecov is reporting a big decrease in test coverage. This PR makes no changes to the codes that it's reporting a coverage decrease. Not too familiar with codecov, but I think this shouldn't be a blocker for this PR.

Also, because of GitLab v16 requirements of bot users must have an expiry date, couple of existing acceptance tests are failing in this PR.

=========================== short test summary info ============================
ERROR tests/acceptance/standard/test_group_members_users.py::TestGroupMembersUsers::test__remove_user_keep_bots - gitlab.exceptions.GitlabCreateError: 400: expires_at is missing
ERROR tests/acceptance/standard/test_members_enforce.py::TestMembersEnforce::test__enforce_keep_bots - gitlab.exceptions.GitlabCreateError: 400: expires_at is missing
============== 102 passed, 2 errors, 6 rerun in 223.73s (0:03:43) ==============

I believe this should be fixed as part of #554.

So, I'm leaning towards merging this PR soon even with the reported failures. It will at least resolve the issue with acceptance tests not running in the CI and unblock #554 . Thoughts?

Copy link
Member

@gdubicki gdubicki left a comment

Choose a reason for hiding this comment

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

BIG thank you for resolving this, @amimas ! I agree, let’s merge this first and deal with other failing tests later.

@amimas amimas merged commit 35e214d into gitlabform:main Jul 12, 2023
19 of 25 checks passed
@amimas amimas deleted the fix-ci-gitlab-setup branch July 12, 2023 13:17
@amimas amimas mentioned this pull request Jul 23, 2023
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.

None yet

2 participants