From 5aef69cd940e05cadc365bed4af835cd7e82a78e Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 16:52:24 -0300 Subject: [PATCH 01/11] fix: eliminar los guiones bajos al principio del nombre de archivo #14953 porque jekyll los toma como archivos ocultos --- .../active_storage/direct_uploads_controller_decorator.rb | 2 +- app/lib/action_dispatch/http/uploaded_file_decorator.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/active_storage/direct_uploads_controller_decorator.rb b/app/controllers/active_storage/direct_uploads_controller_decorator.rb index c62dae2a..5ac58ecf 100644 --- a/app/controllers/active_storage/direct_uploads_controller_decorator.rb +++ b/app/controllers/active_storage/direct_uploads_controller_decorator.rb @@ -19,7 +19,7 @@ module ActiveStorage # stack. def blob_args params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, metadata: {}).to_h.symbolize_keys.tap do |ba| - ba[:filename] = ba[:filename].unicode_normalize + ba[:filename] = ba[:filename].unicode_normalize.sub(/\A_+/, '') end end end diff --git a/app/lib/action_dispatch/http/uploaded_file_decorator.rb b/app/lib/action_dispatch/http/uploaded_file_decorator.rb index 0bdebdc0..7b28a0db 100644 --- a/app/lib/action_dispatch/http/uploaded_file_decorator.rb +++ b/app/lib/action_dispatch/http/uploaded_file_decorator.rb @@ -11,7 +11,7 @@ module ActionDispatch # Devolver el nombre de archivo con caracteres unicode # normalizados def original_filename - @original_filename.unicode_normalize + @original_filename.unicode_normalize.sub(/\A_+/, '') end end end From 76644700d164060079c125148b6a7f62d50ca4ba Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:03:37 -0300 Subject: [PATCH 02/11] fix: traer la lista de archivos modificados --- bin/modified_files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/modified_files b/bin/modified_files index 37bcabeb..d26e71f3 100755 --- a/bin/modified_files +++ b/bin/modified_files @@ -3,6 +3,6 @@ set -e test -n "${CI_MERGE_REQUEST_DIFF_BASE_SHA}" -git diff --name-status ${CI_MERGE_REQUEST_DIFF_BASE_SHA}...origin/rails \ +git diff --name-status ${CI_MERGE_REQUEST_DIFF_BASE_SHA} \ | grep -v "^D" \ | cut -f 2 From 9c97e0f87c3c618083444d75af4f5b8021d2a16c Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:08:05 -0300 Subject: [PATCH 03/11] =?UTF-8?q?ci:=20por=20qu=C3=A9=20faltan=20las=20gem?= =?UTF-8?q?as=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 38f480c9..39d7787f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,6 +81,7 @@ rubocop: before_script: - *apk-add - *disable-hainish + - ls -hal vendor/ruby script: - "./bin/modified_files | ./bin/with_extension rb | xargs -r go-task bundle -- exec rubocop" haml: From a78d02d84af8fb4bc9db2e23a7b18a2bb5ef2dee Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:10:55 -0300 Subject: [PATCH 04/11] =?UTF-8?q?fixup!=20ci:=20por=20qu=C3=A9=20faltan=20?= =?UTF-8?q?las=20gemas=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39d7787f..aa3677f2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,6 +81,9 @@ rubocop: before_script: - *apk-add - *disable-hainish + - env + - ls -hal vendor + - ls -hal vendor - ls -hal vendor/ruby script: - "./bin/modified_files | ./bin/with_extension rb | xargs -r go-task bundle -- exec rubocop" From 1ede2af465114a80c776e116d40a537f851334f7 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:18:36 -0300 Subject: [PATCH 05/11] fix: instalar dependencias --- Taskfile.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 8427db4a..c2d72472 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -24,11 +24,14 @@ tasks: deps: - "credentials" cmds: - - task: "bundle" + - "{{.HAINISH}} bundle config set --local path './vendor'" + - "{{.HAINISH}} bundle install" sources: - "Gemfile" generates: - "Gemfile.lock" + status: + - "test -d vendor/ruby" clean: desc: "Clean" cmds: From 24120bfd904101e42e722ef9dc456da03e129a81 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:18:58 -0300 Subject: [PATCH 06/11] =?UTF-8?q?fix:=20agregar=20configuraci=C3=B3n=20de?= =?UTF-8?q?=20bundler=20a=20la=20cach=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa3677f2..0e38e7d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ .cache-ruby: &cache-ruby - paths: - "vendor/ruby" + - ".bundle" .cache-node: &cache-node - paths: - "node_modules" From 987e19f565e7e85ae68836ddb552a83d315e1e51 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:24:51 -0300 Subject: [PATCH 07/11] =?UTF-8?q?fixup!=20fixup!=20ci:=20por=20qu=C3=A9=20?= =?UTF-8?q?faltan=20las=20gemas=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e38e7d6..e4cee087 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ .apk-add: &apk-add -- "apk add go-task diffutils" +- "apk add go-task diffutils gitlab_ci_log_section" .disable-hainish: &disable-hainish - "rm -f .env.development" .cache-ruby: &cache-ruby @@ -27,13 +27,18 @@ assets: - *cache-node - *cache-task before_script: + - "gitlab_ci_log_section --name git --header=\"Configuring git\"" - "git config --global user.email \"${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}\"" - "git config --global user.name \"${GIT_USER_NAME:-$GITLAB_USER_NAME}\"" - "git remote set-url --push origin \"https://${GITLAB_USERNAME}:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git\"" + - "gitlab_ci_log_section --name git --end" + - "gitlab_ci_log_section --name apk --header=\"Installing dependencies\"" - "apk add brotli" - *apk-add - *disable-hainish + - "gitlab_ci_log_section --name apk --end" script: + - "gitlab_ci_log_section --name assets --header=\"Building\"" - "go-task assets" after_script: - "git add public && git commit -m \"ci: assets [skip ci]\"" @@ -82,10 +87,6 @@ rubocop: before_script: - *apk-add - *disable-hainish - - env - - ls -hal vendor - - ls -hal vendor - - ls -hal vendor/ruby script: - "./bin/modified_files | ./bin/with_extension rb | xargs -r go-task bundle -- exec rubocop" haml: From 7f3d87b3177f3f87b3b4bc484be3ffec751b7edc Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:29:32 -0300 Subject: [PATCH 08/11] chore: rubocop --- .../active_storage/direct_uploads_controller_decorator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/active_storage/direct_uploads_controller_decorator.rb b/app/controllers/active_storage/direct_uploads_controller_decorator.rb index 5ac58ecf..94070882 100644 --- a/app/controllers/active_storage/direct_uploads_controller_decorator.rb +++ b/app/controllers/active_storage/direct_uploads_controller_decorator.rb @@ -18,7 +18,8 @@ module ActiveStorage # para que puedan propagarse correctamente a través de todo el # stack. def blob_args - params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, metadata: {}).to_h.symbolize_keys.tap do |ba| + params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, + metadata: {}).to_h.symbolize_keys.tap do |ba| ba[:filename] = ba[:filename].unicode_normalize.sub(/\A_+/, '') end end From 1fbfd30017079bafaff19021b32d8587f95fa116 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:18:36 -0300 Subject: [PATCH 09/11] fix: instalar dependencias --- Taskfile.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 8427db4a..c2d72472 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -24,11 +24,14 @@ tasks: deps: - "credentials" cmds: - - task: "bundle" + - "{{.HAINISH}} bundle config set --local path './vendor'" + - "{{.HAINISH}} bundle install" sources: - "Gemfile" generates: - "Gemfile.lock" + status: + - "test -d vendor/ruby" clean: desc: "Clean" cmds: From 7e43d8f3326bc91e87b224a4b2eea51058ef4694 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:18:58 -0300 Subject: [PATCH 10/11] =?UTF-8?q?fix:=20agregar=20configuraci=C3=B3n=20de?= =?UTF-8?q?=20bundler=20a=20la=20cach=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 38f480c9..fd67b54a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ .cache-ruby: &cache-ruby - paths: - "vendor/ruby" + - ".bundle" .cache-node: &cache-node - paths: - "node_modules" From 6ec99072736dae32e8aef1f068e78e0ea2fbc254 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 17:29:32 -0300 Subject: [PATCH 11/11] chore: rubocop --- .../active_storage/direct_uploads_controller_decorator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/active_storage/direct_uploads_controller_decorator.rb b/app/controllers/active_storage/direct_uploads_controller_decorator.rb index 5ac58ecf..94070882 100644 --- a/app/controllers/active_storage/direct_uploads_controller_decorator.rb +++ b/app/controllers/active_storage/direct_uploads_controller_decorator.rb @@ -18,7 +18,8 @@ module ActiveStorage # para que puedan propagarse correctamente a través de todo el # stack. def blob_args - params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, metadata: {}).to_h.symbolize_keys.tap do |ba| + params.require(:blob).permit(:filename, :byte_size, :checksum, :content_type, + metadata: {}).to_h.symbolize_keys.tap do |ba| ba[:filename] = ba[:filename].unicode_normalize.sub(/\A_+/, '') end end