Skip to content

[PM-37746] Add fallback to local sdk package#2665

Open
LRNcardozoWDF wants to merge 4 commits into
mainfrom
cmcg/pm-37746-fix-generate-mocks-script-for-local-sdk
Open

[PM-37746] Add fallback to local sdk package#2665
LRNcardozoWDF wants to merge 4 commits into
mainfrom
cmcg/pm-37746-fix-generate-mocks-script-for-local-sdk

Conversation

@LRNcardozoWDF

@LRNcardozoWDF LRNcardozoWDF commented May 19, 2026

Copy link
Copy Markdown
Member

🎟️ Tracking

PM-37746

📔 Objective

Fall back to a local sdk-internal checkout and locally built sdk package when "LOCAL_SDK=true bootstrap".

📸 Screenshots

@LRNcardozoWDF LRNcardozoWDF requested review from a team and matt-livefront as code owners May 19, 2026 12:40
@github-actions github-actions Bot added the t:ci Change Type - Updates to automated workflows label May 19, 2026
@LRNcardozoWDF LRNcardozoWDF marked this pull request as draft May 19, 2026 12:42
@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.88%. Comparing base (8d5ef99) to head (8bbc540).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2665      +/-   ##
==========================================
- Coverage   87.83%   86.88%   -0.95%     
==========================================
  Files        1707     1891     +184     
  Lines      165908   179009   +13101     
==========================================
+ Hits       145728   155536    +9808     
- Misses      20180    23473    +3293     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LRNcardozoWDF LRNcardozoWDF force-pushed the cmcg/pm-37746-fix-generate-mocks-script-for-local-sdk branch from 8540b1a to 9474709 Compare May 29, 2026 14:28
@LRNcardozoWDF LRNcardozoWDF marked this pull request as ready for review May 29, 2026 14:31
@LRNcardozoWDF LRNcardozoWDF added the ai-review Request a Claude code review label May 29, 2026
Comment thread Scripts/generate-mocks.sh Outdated
Comment on lines 61 to 70
if [ -z "$BITWARDEN_SDK_PATH" ]; then
# Last resort: local sdk-internal checkout at the well-known sibling path.
# SRCROOT is set by Xcode in build phases; derive from script location for standalone runs.
_script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
_repo_root="$(dirname "$_script_dir")"
_local_sdk_path="${SRCROOT:-$_repo_root}/../sdk-internal/crates/bitwarden-uniffi/swift"
if [ -d "$_local_sdk_path" ]; then
BITWARDEN_SDK_PATH="$(cd "$_local_sdk_path" && pwd)"
fi
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Is this needed? I mean wouldn't this end up being the exact same as the BITWARDEN_SDK_PATH path passed in local-idk.yml -> settings? Or which potential path case would this cover?

@LRNcardozoWDF LRNcardozoWDF Jun 5, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! You're right, lines 61-69 can be removed. Thank you

@LRNcardozoWDF LRNcardozoWDF requested a review from fedemkr June 5, 2026 11:32
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR adds a fallback for BITWARDEN_SDK_PATH so that generate-mocks.sh works when developers bootstrap with LOCAL_SDK=true. The change injects the local SDK path as an Xcode build setting via Configs/local-sdk.yml, and generate-mocks.sh now skips its DerivedData search when that variable is already set. Scope is limited to two build-tooling files (18 additions, 10 deletions) with no production-code or security impact.

Code Review Details

No actionable findings. The if [ -z "${BITWARDEN_SDK_PATH:-}" ] guard correctly composes with set -euo pipefail, the header comment clearly documents both the remote and local SDK paths, and the previously-noted redundant fallback block (lines 61-69 in an earlier revision) was removed in commit 8bbc540b0, resolving the existing reviewer comment from @fedemkr.

Comment thread Scripts/generate-mocks.sh
Comment on lines 62 to 65
if [ -z "$BITWARDEN_SDK_PATH" ]; then
echo "error: Could not locate sdk-swift checkout under SourcePackages/ — ensure SPM packages are resolved before running Sourcery."
exit 1
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ I think this error message should be updated as SourcePackages/ path is only for non-local flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review t:ci Change Type - Updates to automated workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants