Revert "increase to 10 chars for good measure"

This reverts commit 941230671c.
This commit is contained in:
Tomas Hykel
2026-05-28 13:23:51 +02:00
parent accd7a0628
commit 7e3fbfbb65
3 changed files with 3 additions and 3 deletions
@@ -64,7 +64,7 @@ module ProjectIdentifiers
def handle_update_failure(classic_id, error)
Rails.logger.warn "#{self.class}: Could not set identifier '#{classic_id}' for project #{project.id}; " \
"falling back to a randomized suffix. (#{error.message})"
project.update!(identifier: "project-#{SecureRandom.alphanumeric(10).downcase}")
project.update!(identifier: "project-#{SecureRandom.alphanumeric(5).downcase}")
end
def identifier_generator
@@ -132,7 +132,7 @@ RSpec.describe ProjectIdentifiers::RevertProjectToClassicService do
it "assigns a project-NNNNN fallback identifier" do
described_class.new(project).call
expect(project.reload.identifier).to match(/\Aproject-[a-z0-9]{10}\z/)
expect(project.reload.identifier).to match(/\Aproject-[a-z0-9]{5}\z/)
end
it "logs a warning containing the project id and the conflicting identifier" do
@@ -156,7 +156,7 @@ RSpec.describe ProjectIdentifiers::RevertInstanceToClassicIdsJob do
end
it "assigns project_conflict a project-NNNNN fallback identifier" do
expect(project_conflict.reload.identifier).to match(/\Aproject-[a-z0-9]{10}\z/)
expect(project_conflict.reload.identifier).to match(/\Aproject-[a-z0-9]{5}\z/)
end
end
end