-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
AWS CodeCommit support #2868
Comments
I haven't planned on it before now, but it looks they have an API with endpoints such as CreatePullRequest, so it looks promising. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Any update on this? |
No, it likely needs some outside contributions to get it moving. |
I'd like to take this one. |
@olegkrivtsov this could be a lot of work. but at least we can start with the research side of things (working out if all the APIs we need are supported, such as issues, PRs, etc). Do you have an AWS account you can test with? |
Hi @rarkins ok, I can start by reviewing the AWS APIs and check what capabilities they have. Creating AWS account shouldn't be difficult. |
Could you please assign this to me so it's easier for me to track? |
Hi @rarkins I found this page describing AWS CodeCommit APIs: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CodeCommit.html It seems that CodeCommit APIs support managing the following:
However, it doesn't have an integrated issue tracker. And it also seems it has some support of "labels" they call "tags", so it may be possible to label a PR. |
We can get by without issues if they don't have them. Please map each of these to API documentation: renovate/lib/platform/types.ts Lines 150 to 190 in db5137b
|
I tried to map those functions to the API endpoints (https://docs.aws.amazon.com/codecommit/latest/APIReference):
The above are not available. CodeCommit doesn't support issues.
It seems that vulnerability alerts are not supported by CodeCommit.
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetFile.html
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetRepository.html
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_ListPullRequests.html
The above are not supported by CodeCommit.
This is non-related to API, right?
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_UpdatePullRequestDescription.html
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_MergePullRequestByThreeWay.html
I don't think the API has endpoints for these. It seems that CodeCommit uses AWS IAM roles as "usernames". When we create a PR, it is assigned an ARN (IAM role ID). I'm not aware of its ability to add assignees/reviewers.
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_CreatePullRequest.html
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_ListRepositories.html
It seems this is not related to API.
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_UntagResource.html
As far as I could determine:
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetBranch.html
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_DeleteCommentContent.html
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_UpdateComment.html
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetPullRequest.html ``
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetCommit.html
https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetPullRequest.html
I guess this is not related to API.
I think this is not supported by AWS CodeCommit. |
I've created a POC Code that will clone + create branch + commit + create PR, and it works like a charm. Requirements input from user:
Note: according to the documentation it tells you to create an HTTP user and password for http calls Code Sample for git clone
Code Sample for API call
API Reference: https://docs.aws.amazon.com/codecommit/latest/APIReference/Welcome.html im planning to start implementing the platform interfaces WDYT guys? |
Awesome! Can we incorporate the region as part of "endpoint"? And key/secret as username/password? Ie to avoid adding new config fields. Best if you can clarify what new configuration you think is necessary so we can confirm. |
Well i dont think we need any new configurations if we are going to use What do you mean "part of |
Our endpoints all start with https:// so far |
Can we eliminate the requirement for an access/secret key? It should fall through to the SDK credential chain, making it compatible with aws-cli config, environment variables, or an execution role (ec2 instance profile, for example). Also, when I clone from codecommit, I write this to my .gitconfig and let the aws-cli helper authenticate me:
(fwiw, our team has been heavily involved in the Dependabot support for CodeCommit, and can confirm that this setup works there... happy to consult here also!) |
i think that can be improved in a later PR. for first implementation it would be ok to force the manual config |
Not Supported Platform API list addAssignees, |
deleteLabel is used here:
It's a way of requesting a rebase for a PR. We prefer using the checkbox approach, but that doesn't work on every platform |
Do CodeCommit PRs have the concept of assignees or reviewers? i.e. is it a codecommit limitation in general or just a missing API for something which is available in the UI?
No issue support in the CodeCommit platform? Same as Bitbucket Cloud and Azure DevOps if so
No problem here, only GitHub supports
Makes automerge not possible, maybe impacts some other things. I don't recall if any other platforms have this gap
Makes |
there's also this git tags are supported |
|
|
@viceice https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BuildStatusConfig.html is not build status its just the config after deeper investigation i still cant figure out how to do this, i will check with AWS team in meeting when we will have it : https://docs.aws.amazon.com/codebuild/latest/APIReference/API_Build.html looks promising it has :
so i could do CodeBuildAPI =>
then use BatchGetBuilds, which accepts the build ids and then we get an array of builds as a result, those builds include the field : "buildStatus": "string", but im having a problem connecting that build to the repo or branch, see all params coming back from builds:
|
ok, Sounds good |
update: the repo name where this build happened the branch i believe where this build ran the build status( see above comment for more info about buildStatus): so we have a way to reach this, in a different way, |
can we use |
thats bad, we should exclude status checks from initial support until we find a proper solution for it. maybe the aws team can provide a new api ?🙃 |
i'm planning on asking them, that's why i investigated the current possibilities fully, still waiting for the meeting, |
adding reviewers is supported!, it supports multiple assignees/Approvers too. |
Regarding getPrList():
If someone were to use Renovate with CodeCommit for long they'd build up hundreds or thousands of closed PRs, so fetching this full list for both open and closed would be too inefficient. Therefore I'm considering:
This would mean that functionality such as "Close to ignore this PR" is unavailable, because we won't know about closed PRs. Otherwise, most functionality should work. |
@rarkins i like the idea, im just worried about the limitation, what's the alternative for "Close to ignore this PR"? |
Yes, it will mean all PRs are immortal. Realistically we need AWS to fix this feature gap so that there is not diminished performance or experience. |
i have tried to use AWS Enterprise account with a low profile user, and i asked for permission from devops for codecommit access. so i added support for it using the Environment Variable should i add support in config as well? WDYT? |
And there is
Is there no way to gain a permanent access? |
Permamenent access is the default. But it comes at the risk of a security breach. i've used i'm not sure if to add the session token to the config or keep it as an environment support only. |
Supporting It's a bit similar as the option I mentioned earlier, relying on the AWS SDK to resolve the credential chain without specifying an access/secret key in the renovate config. That would then work with self-hosted renovate when running with an EC2 instance profile or a Codebuild execution role. That setup also uses temporary credentials that can be refreshed automatically. |
hey all, |
@carlosfunk , @jspenguin2017 , @chris2k2 , @jessieweiyi , @olegkrivtsov , @lorengordon Do any of you guys still have an interest in this feature? would appreciate your feedback |
I probably won't get a chance to actually run it, but did have a question about this part:
If I close the PR, but leave the branch behind, will Renovate still recreate the PR? I know Dependabot in that condition will skip that dependency update, no need to change any config. Makes for a nice compromise. |
the reason behind this is that AWS requires you to pull all pull requests one by one. so if you have a repository with 2000 pull requests, it will do 2001 client requests we opened #19427 to give users that option. |
I will now close this issue as completed, as AWS CodeCommit is officially supported |
Are there any plans to support AWS CodeCommit?
The text was updated successfully, but these errors were encountered: