aws_codecommit: initial repository code does not retain file permission mode
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
[CodeCommit repository](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codecommit.Repository.html) has a construct prop `code` that should include the initial code of repository. I am using Java CDK `Code.fromDirectory` to create the code object.
My local files are executable (permission 755). The files finally in the CodeCommit repository are not executable (permission 644).
### Expected Behavior
The files uploaded to CodeCommit should remain their file permission mode.
### Current Behavior
Local executable files, when uploaded to CodeCommit repository, do not have the execution bit set in their permission mode.
### Reproduction Steps
Using Java CDK:
```
Repository repository = Repository.Builder.create(this, "Repository")
.code(Code.fromDirectory("./revisions/codesuite"))
.build();
```
Put some files in the `./revisions/codesuite` folder.
Then run `chmod a+x ./revisions/codesuite/*`
Create the stack.
Use `git clone` to download the files from the CodeCommit repository.
Use `ls -la` to check the file permission mode.
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.62.2 (build c164a49)
### Framework Version
_No response_
### Node.js Version
v14.17.0
### OS
Mac
### Language
Java
### Language Version
OpenJDK Runtime Environment Corretto-8.362.08.1 (build 1.8.0_362-b08)
### Other information
_No response_
Contributor guide
Research direction
Start with the aws_codecommit Repository construct and the Code.fromDirectory path described in the reproduction, then reproduce the behavior with an executable local file and inspect the resulting CodeCommit checkout using ls -la. Done means files uploaded through the code prop retain their local executable permission mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java, typescript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100