Commit has the wrong Author

0

Hello,

A commit to CodeCommit repository has an Author an IAM user X (the one used to initialize eb cli), while it has been pushed using the credentials of another IAM user Y which is the one having "AWSCodeCommitFullAccess" permission.

I guess I am missing something here.
Does anybody have a clue?

posta 5 anni fa614 visualizzazioni
3 Risposte
0

Hi,

Git commits have two identifying pieces of information(author, and committer). In the AWS console, we (currently) only display the 'committer' value, (which is confusingly labeled as 'author'). I suspect your commit has differing author and committer values.

To validate these values with CodeCommit, you can call our 'get-commit' api directly from the AWS CLI. To do this, first configure your system with the AWS CLI (follow instructions on https://aws.amazon.com/cli/), and configure the CLI with credentials to access your AWS account where your CodeCommit repository lives.

Provide the repository name and 40-character SHA-1 of the commit to the api input:

 aws codecommit get-commit --repository-name <repository-name> --commit-id <c2c67acfe...
> ```

The output should contain both Author and Committer information, and you should be able to validate the author and committer are as you expect. More information on 'get-commit' can be found on the get-commit cli documentation page: <https://docs.aws.amazon.com/cli/latest/reference/codecommit/get-commit.html>  
  
I have also filed an issue internally to display both Author and Committer values through the AWS Console page when the values differ. Thanks for your feedback!
AWS
con risposta 5 anni fa
0

Hi David,

Thank you for your reply.
The API has returned the same user for Author and Committer: the user that initialized the EB CLI and the local git repository.

The thing that I was confused about is the following:
the commit had been pushed using the Git Credentials of another user which has the "AWS CodeCommit Managed Policy", which I thought would make this user to show as Committer in CodeCommit.

Could you please provide some links or information on how to have two committers (IAM users) in AWS cloud9 environment? So eventually in CodeCommit, we will see the two IAM users show, each one for his own commits.

con risposta 5 anni fa
0

For future inquirers, CodeCommit console does show the author of the commit.
If more than one developer are committing to the repository, the author of a commit can be set in a convenient way while committing like the following:

git commit --author="NAME <EMAIL>" -m "commit label"

con risposta 5 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande