[PR #4538] [MERGED] [PM-16827] Fix test.yml sdk package access and refactor test jobs #5024

Closed
opened 2025-11-26 23:53:00 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4538
Author: @vvolkgang
Created: 1/9/2025
Status: Merged
Merged: 1/9/2025
Merged by: @SaintPatrck

Base: mainHead: improve-test


📝 Commits (10+)

  • fa62602 Split jobs
  • 57dc36c Update upload filepath
  • 5bb1e02 Set codecov OS
  • ab4f6a8 Comment PR when uploading test coverage report fails
  • 91a0c7b Output error message to run summary too.
  • 17c2018 Remove step event restriction
  • b45c79d Use continue on error to force step to succeed
  • e9cc55b Improve error output
  • 7dcfab8 Add github repo flag to gh cli command to remove the need to checkout the repo
  • a6f876b Add PR Actor to PR comment

📊 Changes

1 file changed (+47 additions, -9 deletions)

View changed files

📝 .github/workflows/test.yml (+47 -9)

📄 Description

🎟️ Tracking

PM-16827

📔 Objective

  1. Fixes sdk package retrieval by bringing back the github token env var removed in https://github.com/bitwarden/android/pull/4488
  2. Split test job to reduce the GitHub Token permissions surface in each job, scoping it to packages access only for gradle
  3. Adds a comment to the PR when code coverage report upload fails. Example

Important

About 3., while testing the initial changes I noticed that when the codecov action fails, it's a silent error by design and won't fail the workflow job. This is the case if the coverage report can't be found for instance. Discussing it with @SaintPatrck we agreed that uploading code coverage reports shouldn't block a PR so it should continue to not fail workflow jobs, but we needed to raise visibility of errors when that happens. The quickest win was adding a comment to the PR tagging the user that triggered the action run.

📸 Screenshots

image

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/4538 **Author:** [@vvolkgang](https://github.com/vvolkgang) **Created:** 1/9/2025 **Status:** ✅ Merged **Merged:** 1/9/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `improve-test` --- ### 📝 Commits (10+) - [`fa62602`](https://github.com/bitwarden/android/commit/fa626024981010f663a3ec75a32b34678be20fe7) Split jobs - [`57dc36c`](https://github.com/bitwarden/android/commit/57dc36c78ce8631e957c64151ed1add720dffb3e) Update upload filepath - [`5bb1e02`](https://github.com/bitwarden/android/commit/5bb1e024420dce7c81760afbafb41953e3d27746) Set codecov OS - [`ab4f6a8`](https://github.com/bitwarden/android/commit/ab4f6a8d96b9b0512aa0b2f936c81a20abd68479) Comment PR when uploading test coverage report fails - [`91a0c7b`](https://github.com/bitwarden/android/commit/91a0c7b8dcd52a3446820aa7f9aa41087bd0f194) Output error message to run summary too. - [`17c2018`](https://github.com/bitwarden/android/commit/17c2018ed7375a849b614543c8b8a77a749224fc) Remove step event restriction - [`b45c79d`](https://github.com/bitwarden/android/commit/b45c79d000ab272eebc8b0e874d12706404cba49) Use continue on error to force step to succeed - [`e9cc55b`](https://github.com/bitwarden/android/commit/e9cc55b9edfe3adf08024c7dc4e64e852122eab7) Improve error output - [`7dcfab8`](https://github.com/bitwarden/android/commit/7dcfab8e1cd95d9b93fc5c93b639b1b1f8e7dc74) Add github repo flag to gh cli command to remove the need to checkout the repo - [`a6f876b`](https://github.com/bitwarden/android/commit/a6f876bf2701b046be87204d7dfdfc77b37b11be) Add PR Actor to PR comment ### 📊 Changes **1 file changed** (+47 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yml` (+47 -9) </details> ### 📄 Description ## 🎟️ Tracking [PM-16827](https://bitwarden.atlassian.net/browse/PM-16827) ## 📔 Objective 1. Fixes sdk package retrieval by bringing back the github token env var removed in https://github.com/bitwarden/android/pull/4488 2. Split test job to reduce the GitHub Token permissions surface in each job, scoping it to packages access only for gradle 3. Adds a comment to the PR when code coverage report upload fails. [Example](https://github.com/bitwarden/android/pull/4538#issuecomment-2580778503) > [!IMPORTANT] > About 3., while testing the initial changes I noticed that when the codecov action fails, it's a silent error by design and won't fail the workflow job. This is the case if the coverage report can't be found for instance. Discussing it with @SaintPatrck we agreed that uploading code coverage reports shouldn't block a PR so it should continue to not fail workflow jobs, but we needed to raise visibility of errors when that happens. The quickest win was adding a comment to the PR tagging the user that triggered the action run. ## 📸 Screenshots <img width="916" alt="image" src="https://github.com/user-attachments/assets/4613f275-6b2a-436c-af0f-73d7babc44ba" /> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes [PM-16827]: https://bitwarden.atlassian.net/browse/PM-16827?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:53:00 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5024