Implement Retry Logic for Buyer Experience Artifact Download

Summary

This MR adds a retry mechanism to the Buyer Experience artifact download process in the pull_buyer_experience_artifacts.rb script. The new logic will attempt to download the artifacts up to 5 times, with a 2-hour interval between attempts, to address issues with scheduled jobs that don't always build full artifacts.

Changes

  • Modified scripts/pull_buyer_experience_artifacts.rb to include retry logic
  • Added a loop that attempts the download up to 5 times
  • Implemented a 2-hour delay between retry attempts
  • Improved error handling and logging for the download process

Motivation

Some of our scheduled jobs don't consistently build full artifacts, causing pipeline failures. This change aims to increase the reliability of our artifact download process, reducing pipeline failures and improving overall CI/CD stability.

Related Issue

Resolves gitlab-com/marketing/digital-experience/buyer-experience#3798 (closed)

Implementation Details

  1. The script now uses a while loop to attempt the download up to 5 times.
  2. Each failed attempt is followed by a 2-hour wait period before the next try.
  3. Improved logging has been added to track the number of attempts and their outcomes.
  4. If all 5 attempts fail, the script will exit with an error code.

Testing

  • Simulate a download failure and confirm that the retry mechanism works as expected by running script locally with ruby scripts/pull_buyer_experience_artifacts.rb
  • Ensure that the script exits properly after 5 failed attempts
  • Review on production with first scheduled delete job

Author and Reviewer Checklist

Please verify the check list and ensure to tick them off before the MR is merged.

  • Provided a concise title for this Merge Request (MR)
  • Added a description to this MR explaining the reasons for the proposed change, per say why, not just what
    • Copy/paste the Slack conversation to document it for later, or upload screenshots. Verify that no confidential data is added, and the content is SAFE
  • Assign reviewers for this MR to the correct Directly Responsible Individual/s (DRI)
    • If the DRI for the page/s being updated isn’t immediately clear, then assign it to one of the people listed in the Maintained by section on the page being edited
    • If your manager does not have merge rights, please ask someone to merge it AFTER it has been approved by your manager in #mr-buddies
    • The when to get approval handbook section explains the workflow in more detail
  • For transparency, share this MR with the audience that will be impacted.
    • Team: For changes that affect your direct team, share in your group Slack channel
    • Department: If the update affects your department, share the MR in your department Slack channel
    • Company: If the update affects all (or the majority of) GitLab team members, post an update in #whats-happening-at-gitlab linking to this MR

Edited by Lauren Barker

Merge request reports

Loading