Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoupdater: delay adding queue head label + minor improvements #108

Merged
merged 7 commits into from
Mar 13, 2024

Commits on Mar 12, 2024

  1. githubclt: return error if BehindBy field in github response is nil

    This never happens but if it does, it ensures we do not return wrongly that the
    PR is uptodate because GetBehindBy() returns 0 if *BehindBy is nil.
    fho committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    0ddd0cc View commit details
    Browse the repository at this point in the history
  2. autoupdate: do not abort suspend procedure in unlikely error case

    If a PR should be in the suspend and active queue because of a bug, continue
    with the suspend procedure and overwrite the existing PR in the suspend queue.
    This ensures that everything continues to work, instead of not not removing the
    PR label and not aborting an update task for it.
    
    The error scenario never happened.
    fho committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    2a35474 View commit details
    Browse the repository at this point in the history
  3. autoupdater: improve debug log messages when suspending a PR

    log when suspending a PR or removing it from the active queue causes another PR
    to be the first one in the queue, this can be handy when debugging issues.
    fho committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    421668b View commit details
    Browse the repository at this point in the history
  4. githubclt: fix: UpdateBranch logs debug up2date message with old head

    UpdateBranch is retrieving the HEAD sha of the PR and then checking if the PR
    branch contains all changes of the base branch by specifying the PR branch name
    as reference.
    Between retrieving the head sha and comparing the branches, the branch might
    have changed which causes that UpdateBranch was logging that the branch is
    up2date with an old head commit.
    
    Fix it by passing the PR head SHA instead of the branch name as reference when
    comparing the branch with it's base.
    fho committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    9a38a1f View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2024

  1. autoupdate: delay adding queue head label

    The queue head label was added as soon as an PR became first in the active
    queue.
    When the github event for the added label was used to trigger CI jobs this
    caused unnecessary runs:
    - the PR might not meet the conditions and the label is removed by the update
      operation shortly afterwards again,
    - the PR might not be first anymore in the queue when the belonging update
      operation runs,´
    
    It can also cause that a PR is wrongly suspended, in the scenario:
    - label added
    - update of PR branch with base branch is scheduled
    - label add triggered CI job run, CI job already runs on the updated HEAD commit
      because of delays,
    - synchronize branch event caused by the update with the base branch, causes
      that the same ci jobs are triggered again (unnecessarily)
    - previously triggered CI jobs are canceled and a failure check event is sent to
      github
    - failure check event causes the PR to be suspended
    fho committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    3016da4 View commit details
    Browse the repository at this point in the history
  2. autoupdate: log commit for that the ready for merge status was retrieved

    This will be helpful to determine if the API returned the status for an old or
    the current HEAD commit.
    fho committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    f589a24 View commit details
    Browse the repository at this point in the history
  3. autoupdate: increase updateBranchPollInterval to 2 seconds

    Triggering the update branch status often returned needed to be repeated 3x
    because the branch updated happened while doing the 2. retry.
    Increase the interval to 2 seconds, to reduce the number of API operations by
    increasing the chance that it was already updated when it is queried the second
    time.
    fho committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    8975680 View commit details
    Browse the repository at this point in the history