krateoplatformops / git-provider

Krateo PlatformOps Git Provider
0 stars 0 forks source link

File permissions are not maintained as such from the template to the created repository. #3

Closed francesco-furnari closed 1 year ago

francesco-furnari commented 1 year ago

Describe the bug The template contains files in the skeleton/app folder which are then copied by the git provider into a destination repository. The permissions of these files are different than those present in the original template repository.

To Reproduce Steps to reproduce the behavior:

  1. Clone the project to check the permissions inside skeleton/app
  2. Check the permissions: ls -lah
  3. Create a project in Insiel using this template (or quarkus, they have all the same issue)
  4. Clone the project created: git clone https://github.insiel.it/insiel/<REPONAME>.git
  5. Check the permissions: ls -lah
  6. See error

Expected behavior The permissions should be the same or at least with a +x permission type in order to execute the mvnw file in the pipeline.

Screenshots

immagine

Desktop (please complete the following information):

banshee86vr commented 1 year ago

Ciao, the problem is related to the configuration of the git client that performs the clone command.

Since this commit about git: https://github.com/git/git/commit/4e55ed32db81d06a4f618e2cc0f9da0e223ae304

The executable bit will not be detected (and therefore will not be set) for paths in a repository with core.filemode set to false, though the users may still wish to add files as executable for compatibility with other users who do have core.filemode functionality.

So, there are two alternatives (at least):

  1. Configure git client in order to clone the repository with right permissions using the flag -c core.filemode=false:

    git clone -c core.filemode=false https://.....
  2. Change permissions of cloned files

banshee86vr commented 1 year ago

It seems that the Git client used by the operator does not maintain the same permissions of the files cloned for the copy. Cloning the targetRepo the executable files missed the permissions.

Following the same steps manually, starting from the same template repository:

The executable files inside the new folder have the correct permissions.

banshee86vr commented 1 year ago

@matteogastaldello Could you please check to see what the problem is?

braghettos commented 1 year ago

Closed with https://github.com/krateoplatformops/git-provider/pull/6 .

francesco-furnari commented 1 year ago

@braghettos Is it possible to update to the new version? Which one is it?

braghettos commented 1 year ago

@francesco-furnari https://github.com/krateoplatformops/git-provider-chart/releases/tag/0.3.4 - You can find it after updating the helm repo.