Skip to content

Handle missing pipeline user name in terraform registry UI

What does this MR do and why?

Handle missing pipeline user name in terraform registry UI

The UI page of Terraform Registry in a project/group isn't displaying the terraform modules if those modules are published through a pipeline and the name of the pipeline's author is missing.

Hides the published by <author> text when pipeline author name is missing.

Example: https://ops.gitlab.net/gitlab-com/gl-infra/terraform-modules/gitlab/project/-/infrastructure_registry

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-03-27_at_12.39.17_AM Screenshot_2024-03-27_at_12.40.32_AM

How to set up and validate locally

  1. run the following in rails console:
# stub file upload
def fixture_file_upload(*args, **kwargs)
  Rack::Test::UploadedFile.new(*args, **kwargs)
end

# create a terraform module package
pkg = FactoryBot.create(:terraform_module_package, project: Project.last)

# link the module to a pipeline that has no user
Packages::BuildInfo.create(package_id: pkg.id, pipeline_id: Ci::Pipeline.where(user_id: nil).last.id)
  1. Visit Project > Operate > Terraform modules and you should find that the module is shown. There should be no error in the console.

Related to #451889 (closed)

Edited by Rahul Chanila

Merge request reports