From ee7d1599e896f82accac69288edc6ff450a53c83 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 9 Jan 2024 18:27:02 -0300 Subject: [PATCH 01/25] fix: limitar el nombre del archivo #14946 --- app/models/metadata_path.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models/metadata_path.rb b/app/models/metadata_path.rb index 95fc7dbb..17085e07 100644 --- a/app/models/metadata_path.rb +++ b/app/models/metadata_path.rb @@ -6,7 +6,7 @@ class MetadataPath < MetadataTemplate # # @return [String] def default_value - File.join(site.path, "_#{lang}", "#{date}-#{slug}#{ext}") + File.join(site.path, "_#{lang}", "#{limited_name}#{ext}") end # La ruta del archivo según Jekyll @@ -46,4 +46,12 @@ class MetadataPath < MetadataTemplate def date post.date.value.strftime('%F') end + + # Limita el nombre de archivo a 255 bytes, de forma que siempre + # podemos guardarlo + # + # @return [String] + def limited_name + "#{date}-#{slug}".mb_chars.limit(255 - ext.length) + end end From c2534578400e416d5560ed1344e58a87d1cc6092 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 10 Jan 2024 11:39:07 -0300 Subject: [PATCH 02/25] fix: env para desarrollo --- .env.development | 1 + 1 file changed, 1 insertion(+) create mode 100644 .env.development diff --git a/.env.development b/.env.development new file mode 100644 index 00000000..df2788b0 --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +HAINISH=../haini.sh/haini.sh From 5aef69cd940e05cadc365bed4af835cd7e82a78e Mon Sep 17 00:00:00 2001 From: f Date: Thu, 11 Jan 2024 16:52:24 -0300 Subject: [PATCH 03/25] 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 04/25] 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 05/25] =?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 06/25] =?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 07/25] 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 08/25] =?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 09/25] =?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 10/25] 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 11/25] 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 12/25] =?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 13/25] 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 9b401f8c120f9cf074779c8c2bea724d21fec854 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 22 Feb 2024 18:13:53 -0300 Subject: [PATCH 14/25] fix: el hostname puede estar en varios lados --- app/models/social_inbox.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/social_inbox.rb b/app/models/social_inbox.rb index 21b0ca45..2f5e7eca 100644 --- a/app/models/social_inbox.rb +++ b/app/models/social_inbox.rb @@ -67,9 +67,12 @@ class SocialInbox end end + # El hostname puede estar en varios lados... + # + # @return [String] def hostname @hostname ||= - site.config.dig('activity_pub', 'hostname') || site.hostname + site.config.dig('activity_pub', 'hostname') || site.config['hostname'] || site.hostname end # Genera una URI dentro de este sitio From 3a382390b1e82f78df79b6910cfd6d4ecdee8c1c Mon Sep 17 00:00:00 2001 From: f Date: Thu, 22 Feb 2024 18:42:20 -0300 Subject: [PATCH 15/25] fix: la social inbox no confirma acciones! --- .../v1/webhooks/social_inbox_controller.rb | 24 ++++++++++++++----- app/models/activity_pub.rb | 8 +++---- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/v1/webhooks/social_inbox_controller.rb b/app/controllers/api/v1/webhooks/social_inbox_controller.rb index c71c4922..1ffc1596 100644 --- a/app/controllers/api/v1/webhooks/social_inbox_controller.rb +++ b/app/controllers/api/v1/webhooks/social_inbox_controller.rb @@ -38,21 +38,33 @@ module Api head :accepted end - # Cuando aprobamos una actividad, recibimos la confirmación y - # cambiamos el estado. + # Cuando la Social Inbox acepta una actividad, la recibimos + # igual y la guardamos por si cambiamos de idea. + # + # @todo DRY def onapproved ActivityPub.transaction do - activity_pub.approve! if activity_pub.waiting? + actor.present? + instance.present? + object.present? + activity.present? + activity_pub.approve! end head :accepted end - # Cuando rechazamos una actividad, recibimos la confirmación y - # cambiamos el estado + # Cuando la Social Inbox rechaza una actividad, la recibimos + # igual y la guardamos por si cambiamos de idea. + # + # @todo DRY def onrejected ActivityPub.transaction do - activity_pub.reject! if activity_pub.waiting? + actor.present? + instance.present? + object.present? + activity.present? + activity_pub.reject! end head :accepted diff --git a/app/models/activity_pub.rb b/app/models/activity_pub.rb index df8e5c5c..07754b87 100644 --- a/app/models/activity_pub.rb +++ b/app/models/activity_pub.rb @@ -21,8 +21,6 @@ class ActivityPub < ApplicationRecord aasm do # Todavía no hay una decisión sobre el objeto state :paused, initial: true - # Estamos esperando respuesta desde la Social Inbox - state :waiting # Le usuarie aprobó el objeto state :approved # Le usuarie rechazó el objeto @@ -46,17 +44,17 @@ class ActivityPub < ApplicationRecord # Si un objeto previamente aprobado fue actualizado, volvemos a # pausarlo. event :pause do - transitions from: %i[waiting approved rejected], to: :paused + transitions from: %i[approved rejected], to: :paused end # La actividad se aprueba event :approve do - transitions from: :waiting, to: :approved + transitions from: %i[paused rejected], to: :approved end # La actividad fue rechazada event :reject do - transitions from: :waiting, to: :rejected + transitions from: %i[paused approved], to: :rejected end end end From fd1d2382fa481ec45888bb036bc8aac27e3d50b4 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 22 Feb 2024 18:42:36 -0300 Subject: [PATCH 16/25] feat: luego de rechazar podemos reportar --- app/models/activity_pub.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/activity_pub.rb b/app/models/activity_pub.rb index 07754b87..217c15a1 100644 --- a/app/models/activity_pub.rb +++ b/app/models/activity_pub.rb @@ -56,5 +56,10 @@ class ActivityPub < ApplicationRecord event :reject do transitions from: %i[paused approved], to: :rejected end + + # Solo podemos reportarla luego de rechazarla + event :report do + transitions from: :rejected, to: :reported + end end end From cba395473c28587c7cfcc25c4797eb6084f63173 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 28 Feb 2024 12:05:09 -0300 Subject: [PATCH 17/25] feat: asignar rol a deploys al crear o modificar el sitio (cherry picked from commit dc82b8cef2ee014898128a8916b75c5358d9646d) --- app/services/site_service.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/services/site_service.rb b/app/services/site_service.rb index eeef0b3f..d8f1f379 100644 --- a/app/services/site_service.rb +++ b/app/services/site_service.rb @@ -26,6 +26,8 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do # que no haya estados intermedios. site.locales = [usuarie.lang] + add_role_to_deploys! + site.save && site.config.write && commit_config(action: :create) && @@ -43,7 +45,10 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do # Actualiza el sitio y guarda los cambios en la configuración def update I18n.with_locale(usuarie&.lang&.to_sym || I18n.default_locale) do - site.update(params) && + site.assign_attributes(params) + add_role_to_deploys! + + site.save && site.config.write && commit_config(action: :update) && site.reset.nil? && @@ -241,6 +246,17 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do private + # Asignar un rol a cada deploy si no lo tenía ya + def add_role_to_deploys! + site.deploys.each do |deploy| + deploy.rol ||= current_role + end + end + + def current_role + @current_role ||= usuarie.rol_for_site(site) + end + def with_all_locales(&block) site.locales.map do |locale| next unless I18n.available_locales.include? locale From d0bd90ab4e8b1d01d9de4042dc1900dbe4876663 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 28 Feb 2024 15:01:36 -0300 Subject: [PATCH 18/25] =?UTF-8?q?fix:=20el=20rol=20todav=C3=ADa=20no=20est?= =?UTF-8?q?=C3=A1=20guardado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit ee10e170ec6b8c6f939173ee647f874d4770bc3b) --- app/services/site_service.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/site_service.rb b/app/services/site_service.rb index d8f1f379..57a4ee59 100644 --- a/app/services/site_service.rb +++ b/app/services/site_service.rb @@ -13,7 +13,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do def create self.site = Site.new params - add_role temporal: false, rol: 'usuarie' + role = add_role temporal: false, rol: 'usuarie' site.deploys.build type: 'DeployLocal' # Los sitios de testing no se sincronizan sync_nodes unless site.name.end_with? '.testing' @@ -26,7 +26,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do # que no haya estados intermedios. site.locales = [usuarie.lang] - add_role_to_deploys! + add_role_to_deploys! role site.save && site.config.write && @@ -247,9 +247,9 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do private # Asignar un rol a cada deploy si no lo tenía ya - def add_role_to_deploys! + def add_role_to_deploys!(role = current_role) site.deploys.each do |deploy| - deploy.rol ||= current_role + deploy.rol ||= role end end From 37511ad3e51a3e3be6efb3a0e05850ab38fbb831 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 28 Feb 2024 15:04:52 -0300 Subject: [PATCH 19/25] fix: generar un rol dentro del sitio (cherry picked from commit 670d6063e56922b3a8f8debdbd45fd823c34e38a) --- app/services/site_service.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/services/site_service.rb b/app/services/site_service.rb index 57a4ee59..d38a4e9a 100644 --- a/app/services/site_service.rb +++ b/app/services/site_service.rb @@ -13,7 +13,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do def create self.site = Site.new params - role = add_role temporal: false, rol: 'usuarie' + role = site.roles.build(usuarie: usuarie, temporal: false, rol: 'usuarie') site.deploys.build type: 'DeployLocal' # Los sitios de testing no se sincronizan sync_nodes unless site.name.end_with? '.testing' @@ -123,11 +123,6 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do GitPushJob.perform_later(site) end - def add_role(temporal: true, rol: 'invitade') - site.roles << Rol.new(site: site, usuarie: usuarie, - temporal: temporal, rol: rol) - end - # Crea la licencia del sitio para cada locale disponible en el sitio # # @return [Boolean] From 6c3b2ab022b50bb15753d5acdd584f76239142d3 Mon Sep 17 00:00:00 2001 From: jazzari Date: Fri, 1 Mar 2024 12:19:51 -0300 Subject: [PATCH 20/25] fix: movido metodo lfs_cleanup en cleanup_service.rb a site::repository --- app/models/site/repository.rb | 5 +++++ app/services/cleanup_service.rb | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/models/site/repository.rb b/app/models/site/repository.rb index acbf6553..58baa5dd 100644 --- a/app/models/site/repository.rb +++ b/app/models/site/repository.rb @@ -235,5 +235,10 @@ class Site r&.success? end + + def lfs_cleanup + site.repository.git_sh("git", "lfs", "prune") + site.repository.git_sh("git", "lfs", "dedup") + end end end diff --git a/app/services/cleanup_service.rb b/app/services/cleanup_service.rb index 28f6f860..e53fbcb4 100644 --- a/app/services/cleanup_service.rb +++ b/app/services/cleanup_service.rb @@ -31,7 +31,7 @@ class CleanupService site.deploys.find_each(&:cleanup!) site.repository.gc - lfs_cleanup + site.repository.lfs_cleanup site.touch end end @@ -46,14 +46,8 @@ class CleanupService Rails.logger.info "Limpiando repositorio git de #{site.name}" site.repository.gc - lfs_cleanup + site.repository.lfs_cleanup site.touch end end - - private - def lfs_cleanup - site.repository.git_sh("git", "lfs", "prune") - site.repository.git_sh("git", "lfs", "dedup") - end end From 291c477aec286e4cbefca321604c91cdf428c65a Mon Sep 17 00:00:00 2001 From: jazzari Date: Fri, 1 Mar 2024 13:11:04 -0300 Subject: [PATCH 21/25] fix: corregido metodo lfs_cleanup --- app/models/site/repository.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/site/repository.rb b/app/models/site/repository.rb index 58baa5dd..687ced12 100644 --- a/app/models/site/repository.rb +++ b/app/models/site/repository.rb @@ -237,8 +237,8 @@ class Site end def lfs_cleanup - site.repository.git_sh("git", "lfs", "prune") - site.repository.git_sh("git", "lfs", "dedup") + git_sh("git", "lfs", "prune") + git_sh("git", "lfs", "dedup") end end end From 48defa9058a5b8980ad89c7e53afffd63416ca83 Mon Sep 17 00:00:00 2001 From: Sutty Date: Wed, 6 Mar 2024 15:30:50 +0000 Subject: [PATCH 22/25] =?UTF-8?q?fix:=20no=20cambiar=20el=20hostname=20si?= =?UTF-8?q?=20se=20lo=20asign=C3=B3=20manualmente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/deploy_distributed_press.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/deploy_distributed_press.rb b/app/models/deploy_distributed_press.rb index addb817d..bc89a8b6 100644 --- a/app/models/deploy_distributed_press.rb +++ b/app/models/deploy_distributed_press.rb @@ -130,7 +130,7 @@ class DeployDistributedPress < Deploy # # @return [nil] def create_remote_site! - self.hostname = site.hostname + self.hostname ||= site.hostname created_site = site_client.create(create_site) From 6ea20a4d55ed6b52bc7321e2f0f18e851c97aa45 Mon Sep 17 00:00:00 2001 From: Sutty Date: Wed, 6 Mar 2024 15:31:40 +0000 Subject: [PATCH 23/25] =?UTF-8?q?fix:=20gitlab=20solo=20acepta=20200=20car?= =?UTF-8?q?acteres=20en=20el=20t=C3=ADtulo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/gitlab_notifier_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/gitlab_notifier_job.rb b/app/jobs/gitlab_notifier_job.rb index 308adfc7..77e865a3 100644 --- a/app/jobs/gitlab_notifier_job.rb +++ b/app/jobs/gitlab_notifier_job.rb @@ -105,7 +105,7 @@ class GitlabNotifierJob < ApplicationJob def title @title ||= ''.dup.tap do |t| t << "[#{exception.class}] " unless javascript? - t << exception.message + t << exception.message[0..200] t << " [#{issue_data[:count]}]" end end From 053ec5674fc5af393a0cceb0a4ca21f2d93c4f98 Mon Sep 17 00:00:00 2001 From: Sutty Date: Wed, 6 Mar 2024 15:30:50 +0000 Subject: [PATCH 24/25] =?UTF-8?q?fix:=20no=20cambiar=20el=20hostname=20si?= =?UTF-8?q?=20se=20lo=20asign=C3=B3=20manualmente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 48defa9058a5b8980ad89c7e53afffd63416ca83) --- app/models/deploy_distributed_press.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/deploy_distributed_press.rb b/app/models/deploy_distributed_press.rb index da8fe209..f80024e8 100644 --- a/app/models/deploy_distributed_press.rb +++ b/app/models/deploy_distributed_press.rb @@ -128,6 +128,8 @@ class DeployDistributedPress < Deploy # # @return [nil] def create_remote_site! + self.hostname ||= site.hostname + created_site = site_client.create(create_site) self.remote_site_id = created_site[:id] From 4081f62ad104706b37c21fc0c46a36ce8360f660 Mon Sep 17 00:00:00 2001 From: Sutty Date: Wed, 6 Mar 2024 15:31:40 +0000 Subject: [PATCH 25/25] =?UTF-8?q?fix:=20gitlab=20solo=20acepta=20200=20car?= =?UTF-8?q?acteres=20en=20el=20t=C3=ADtulo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 6ea20a4d55ed6b52bc7321e2f0f18e851c97aa45) --- app/jobs/gitlab_notifier_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/gitlab_notifier_job.rb b/app/jobs/gitlab_notifier_job.rb index 308adfc7..77e865a3 100644 --- a/app/jobs/gitlab_notifier_job.rb +++ b/app/jobs/gitlab_notifier_job.rb @@ -105,7 +105,7 @@ class GitlabNotifierJob < ApplicationJob def title @title ||= ''.dup.tap do |t| t << "[#{exception.class}] " unless javascript? - t << exception.message + t << exception.message[0..200] t << " [#{issue_data[:count]}]" end end