Skip to content

Send Incident images to Status Page s3 Bucket on publish

Allison Browne requested to merge ab-205166-send-images-to-s3-bucket into master

What does this MR do?

Overview

The Status Page is a static website deployed to a users public s3 bucket.

This MR moves existing files in an issue description or comments to s3 for display on the status page.

This is the last MR that is part of: #205166 (closed)

Technical implementation

We move the files to s3(in this MR) and run a post processing job to correct the html(in another MR).

All of the code to upload files to s3 runs async via a sidekiq job. A publish job is triggered when an issue is updated.

Because files might be large this uses Muilt-part upload to send uploads to the status page s3 bucket.

We limit the user to 5000 attachments in s3 per issue.

This is the last MR that is part of: #205166 (closed)

TODOS:

  • Docs
  • Changelog
  • Correct object storage to use GitlabUploader.open and multipart upload
  • Confirm with large file that multipart is happening correctly
  • Use UploadFinder in UploadsRewriter
  • Confirm with object storage enabled on dev stack
  • Re-Confirm without object storage enabled on dev stack
  • Only transfer that which does not already exist
  • Respect limit
  • Specs
  • Self Review

Testing

Once a status page and a project with some incidents is setup one way to quickly test the unit in the rails console is:

# Publish all
project = Project.where(id: 5000139).first
issues = project.issues.all
issues.each do |issue|
  user_notes = issue.notes
  StatusPage::PublishDetailsService.new(project: project).execute(issue, user_notes)
end

# Unpublish all
project = Project.where(id: 5000139).first
issues = project.issues.all
issues.each do |issue|
  user_notes = issue.notes
  StatusPage::UnpublishDetailsService.new(project: project).execute(issue)
end

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Leitzen

Merge request reports

Loading