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

GL-1723: Added expires_at mandatory arg for codestudio token. #1617

Merged
merged 7 commits into from
Oct 31, 2023

Conversation

akashkska
Copy link
Contributor

The ability to create personal access tokens without expiry was deprecated in GitLab 15.4 and removed in GitLab 16.0. In GitLab 16.0 and later, existing personal access tokens without an expiry date are automatically given an expiry date of 365 days.
Codestudio main branch is upgraded with gitlab 16.x version. hence this is breaking change.
An optional variable in previous version https://archives.docs.gitlab.com/15.11/ee/api/project_access_tokens.html#create-a-project-access-token become mandatory in 16.x.x + versions https://docs.gitlab.com/ee/api/project_access_tokens.html#create-a-project-access-token.
Solution: As a part this PR added mandatory arg expires_at with valid expiry date.

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (86af6e4) 91.84% compared to head (01a88da) 91.84%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1617   +/-   ##
=========================================
  Coverage     91.84%   91.84%           
  Complexity     1819     1819           
=========================================
  Files           124      124           
  Lines          6513     6514    +1     
=========================================
+ Hits           5982     5983    +1     
  Misses          531      531           
Files Coverage Δ
src/Command/CodeStudio/CodeStudioWizardCommand.php 95.13% <100.00%> (+0.03%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@akashkska
Copy link
Contributor Author

akashkska commented Oct 31, 2023

Hi @danepowell I don't see option to add label to this PR due to which one check is failing. This was breaking change for codestudio. will you please help us to add label and merge this PR in main.

@danepowell danepowell added the bug Something isn't working label Oct 31, 2023
@@ -161,8 +161,10 @@ private function createProjectAccessToken(array $project, string $projectAccessT
$this->checklist->completePreviousItem();
}
$this->checklist->addItem("Creating access token named <comment>$projectAccessTokenName</comment>");
$dateTime = new \DateTime('tomorrow');
Copy link
Contributor

Choose a reason for hiding this comment

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

This token needs to be long-lived since it's going to be stored as a CI/CD variable, right? Should we max out the lifetime (1 year)?

@danepowell
Copy link
Contributor

I'm going to go ahead and merge this. If you think the expiry time or anything else needs to be adjusted, let me know.

@danepowell danepowell merged commit bf2b514 into acquia:main Oct 31, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants