question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove PR action not consistently working as expected

See original GitHub issue

Bug Description

Our GitHub Action to remove built artifacts for PRs from the wiki is not working as expected. This is resulting in the wiki growing very large in size which is also slowing down the time to clone it in our builds substantially.

Steps to reproduce

  1. View checks of a closed PR
  2. See remove-pr job failed
    e.g. https://github.com/google/site-kit-wp/runs/696936169?check_suite_focus=true

Screenshots

image

Additional Context

The job fails due to the push failing “error: failed to push some refs to ‘https://github.com/google/site-kit-wp.wiki’” due to missing commits. This may be due to the build-pr job running again when the PR is merged at the same time. Looking at the commits on the wiki, there are cases where PRs are removed successfully (e.g. 1583), so there may be a bit of a race condition.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The remove-pr job should always run when a PR is closed, regardless of build or other action success states

Implementation Brief

  • Set the remove-pr job’s if to run ${{ always() }}
    By default this is set to ${{ success() }} but we want this to always run regardless if other steps failed or not as the PR is closed
  • Merge #1804

See https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions

Note: artifacts deployed to the wiki from previous jobs where remove-pr failed will need to be removed manually.

Paths to clean up
Found files from 51 PRs that are closed and should be removed 
 [ 'refs/pull/1123',
  'refs/pull/1162',
  'refs/pull/1166',
  'refs/pull/1189',
  'refs/pull/1197',
  'refs/pull/1199',
  'refs/pull/1200',
  'refs/pull/1203',
  'refs/pull/1205',
  'refs/pull/1206',
  'refs/pull/1216',
  'refs/pull/1217',
  'refs/pull/1218',
  'refs/pull/1220',
  'refs/pull/1226',
  'refs/pull/1227',
  'refs/pull/1228',
  'refs/pull/1234',
  'refs/pull/1239',
  'refs/pull/1240',
  'refs/pull/1243',
  'refs/pull/1252',
  'refs/pull/1284',
  'refs/pull/1303',
  'refs/pull/1306',
  'refs/pull/1312',
  'refs/pull/1329',
  'refs/pull/1353',
  'refs/pull/1359',
  'refs/pull/1360',
  'refs/pull/1413',
  'refs/pull/1431',
  'refs/pull/1442',
  'refs/pull/1453',
  'refs/pull/1457',
  'refs/pull/1467',
  'refs/pull/1473',
  'refs/pull/1485',
  'refs/pull/1496',
  'refs/pull/1528',
  'refs/pull/1544',
  'refs/pull/1551',
  'refs/pull/1562',
  'refs/pull/1564',
  'refs/pull/1570',
  'refs/pull/1634',
  'refs/pull/1664',
  'refs/pull/1665',
  'refs/pull/1679',
  'refs/pull/1732',
  'refs/pull/1763' ]
Found files from 2 branches that should be removed 
 [ 'refs/heads/1436',
  'refs/heads/fix' ]

QA Brief

Changelog entry

  • N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
aaemnnosttvcommented, Jul 21, 2020

I already removed the old ones manually 👍

One important thing to check is that the job works when the checks previously failed. This seems to be the main reason why there were leftover artifacts because GHA don’t run when previous checks fail by default.

0reactions
tofumattcommented, Jul 29, 2020

I think this is working as the actions are running so marking as approved ✅

Read more comments on GitHub >

github_iconTop Results From Across the Web

Github actions: Stuck in "Expected — Waiting for status to ...
For my unit test workflow actions it's stuck showing “Expected — Waiting for ... Based on what I can see there are certain...
Read more >
Github pull request - Waiting for status to be reported
The simplest solution for me was closing the PR and opening it again. After that, checks where executed as expected ...
Read more >
Disciplinary Actions, Suspension, and Termination of ...
*A work action plan is intended to address inadequate job performance concerns that do not improve after the First Written Warning stage.
Read more >
FDA Announces Bebtelovimab is Not Currently Authorized ...
[11/30/2022] The U.S. Food and Drug Administration today announced bebtelovimab is not currently authorized for emergency use in the U.S. ...
Read more >
Clinical Guidelines (Nursing) : Cardiac telemetry
Introduction. Telemetry is an observation tool that allows continuous ECG, RR, SpO2 monitoring while the patient remains active without the restriction of being...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found