Closed cfg74 closed 1 year ago
@Klaus-Keller fyi.
The code to archive a project is in module @sap-ux/environment-check
. The glob that controls what is included and excluded is here:
The globOptions
can be enhanced by dot: true
to include hidden files starting with .
, see https://www.archiverjs.com/docs/archiver#glob -> https://github.com/yqnn/node-readdir-glob#options.
However, all hidden files would be included then and it is likely, that we would archive files that contain secrets. We exclude already .env
, but there might be more files that we are not aware of.
Proposal: if we find a .gitignore
file, read it and apply the glob rules from it to exclude folders and files from the archive. If we do not find .gitignore
, fall back to a deny list to exclude known files, like currently .env
.
@tobiasqueck @Klaus-Keller any update on this topic?
@cfg74 I think this is ready to be assigned, technical proposal for this feature was discussed and seems to be agreed on:
.gitignore
exists, use it to define what is excluded from the archivePR https://github.com/SAP/open-ux-tools/pull/878 has been merged and will be consumed in Application Modeler extension. Closing this issue.
As a developer, I want to be able to zip/download all files of a project in BAS including configurations in dot files, so that I can upload and run it in a different devspace
Description
Currently the archive command excludes node modules, git configurations and
.env
files but also excludes all dot files. In some cases vital configurations are stored in dot files, and losing them on transfer makes the project not work at the destination, e.g. the.cdsrc.json
file in CAP projects rootsProposal is to include all dot files into the archive, but exclude specifically the ones mentioned above.
Technical Design
Requires update of module
@sap-ux/environment-check
to include dot files.Acceptance Criteria
GivenWhenThen format (https://martinfowler.com/bliki/GivenWhenThen.html)
Given I have a zip archive created from a project with dot file configurations when I execute the "Archive Project" command then the project copy is fully functional in the target
Notes
Tasks