Commit Graph

207 Commits

Author SHA1 Message Date
c76f074563 Merge branch 'main' into ci/gitea-actions/macos-runner 2026-07-30 13:08:29 -03:00
Daniel Arantes Loverde
8af8c7cb5b [macos-runner] Replace SSH-based VM wake/sleep with a dedicated runner container
Drop the SSH + restricted-key design entirely. wake/sleep now runs on a
new macos-ctl runner (its own Docker container on the VPS, Docker socket
mounted) which runs docker start/stop macos directly on the sibling
container - no SSH indirection, and no borrowing of another project's
runner (pedifoods-web) to do it.
2026-07-30 11:57:09 -03:00
Daniel Arantes Loverde
cef21aa160 [macos-runner] Fix wake/sleep jobs to use an actually-registered runner label
runs-on: docker matched no registered runner (labels are macos-release,
atomenta, pedifoods, lc-wallet-web). Use pedifoods, this repo's own
existing always-on runner, to run the wake/sleep SSH steps.
2026-07-30 11:46:04 -03:00
e24b92563b Merge pull request '[macos-runner] Add Gitea Actions workflows for self-hosted macOS CI' (#25) from ci/gitea-actions/macos-runner into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#25
2026-07-30 11:43:51 -03:00
5dac551bd4 Merge branch 'main' into ci/gitea-actions/macos-runner 2026-07-30 11:43:43 -03:00
bdddb7bba2 Merge pull request '[2026-07-resubmission] Add guest browsing flow with App Attest session for App Review resubmission' (#24) from fix/app-review/2026-07-resubmission into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#24
2026-07-30 11:43:25 -03:00
Daniel Arantes Loverde
dda7bbcb17 [macos-runner] Add Gitea Actions workflows for self-hosted macOS CI
Replaces bitrise.yml with equivalent test/beta/release pipelines running
on the self-hosted macos-release runner (act_runner inside a dockur/macos
VM). Each workflow wakes the VM over SSH before the job and stops it
after, since the VM can't be left running 24/7 without starving the
VPS's other services.
2026-07-30 11:35:58 -03:00
Daniel Arantes Loverde
017bd7168f [2026-07-resubmission] Add guest browsing flow with App Attest session for App Review resubmission
Adds a pre-login public store locator (guest session via DeviceCheck/App
Attest, keychain-backed token storage) so the app no longer forces sign-in
before showing any content, plus updated support URL metadata.
2026-07-30 11:35:25 -03:00
3e93196b92 Merge pull request 'Fix cart/checkout delivery fee and address sync' (#23) from fix/cart/delivery-fee-address-sync into main 2026-07-10 12:05:32 -03:00
Daniel Arantes Loverde
fc71228ad5 [cart-checkout] Prefer live appState.address.display over async selectedCustomerAddress for the name
Same class of bug as the earlier matching-cascade fix: selectedCustomerAddress
is resolved asynchronously against the address book and can lag behind or
mismatch. appState.address.display is set synchronously the moment the user
picks an address (AddressesView.selectAddress) — it's the authoritative live
value. customerAddressName had these backwards, checking the async value
first.
2026-07-10 11:43:15 -03:00
Daniel Arantes Loverde
a5878b8326 [cart-checkout] Fix address name hardcoded to 'Casa' in Checkout
CheckoutView.swift's addressSection showed the literal string "Casa"
as the address name/label regardless of which address was actually
selected — only the street/detail line below it (customerAddressLabel)
was wired to real state. Added customerAddressName, preferring
selectedCustomerAddress?.label then appState.address.display, matching
the same fallback pattern already used for the detail line.
2026-07-10 11:37:02 -03:00
Daniel Arantes Loverde
6b77775238 [cart-checkout] Geocode addresses locally when lat/long is missing
Explains why the delivery fee specifically never changed while other
address info (label, street) updated fine after the previous fix:
AddAddressFormView only sets latLong when the CEP lookup happens to
return coordinates (AddAddressFormView.swift:141-146) — plenty of saved
addresses have none. Without coordinates the backend can't distinguish
that address from the previous one, so the fee (and, in Checkout,
checkoutAddressWatchKey itself) never actually changes, without any
error surfacing since it likely falls back to some default fee instead
of rejecting.

Added LocationService.geocodeAddress(street:number:neighborhood:city:
state:zip:), a thin CLGeocoder wrapper, and call it in both
CartView.refreshDeliveryFee and CheckoutView+Logic.
validateDeliveryAddressIfNeeded whenever coordinates are missing,
persisting the result back into appState.address so it doesn't need to
re-geocode on every subsequent check.
2026-07-10 10:55:28 -03:00
Daniel Arantes Loverde
f706492823 [cart-checkout] Match selected address by coordinates before label, not after
CustomerAddress.id is genuinely optional (Services/ApiModels.swift:46) —
some address book entries have no id. AddressesView.selectAddress sets
appState.address.selectedId = address.id directly with no fallback, so
picking one of those addresses leaves selectedId nil. The matching
cascade in both CartView and CheckoutView+Logic then skipped straight to
a label match, which silently collides whenever two addresses share an
empty or duplicate label (common for unnamed entries), and finally fell
back to addresses.first — always redisplaying whatever's first in the
list regardless of what was tapped, with no error surfaced anywhere.

Coordinates are set immediately and reliably at selection time and are
far less likely to collide than a label. Checkout already had a lat/lng
fallback but ordered after the weak label match; promoted it ahead of
label matching in both files, and added the same fallback to Cart, which
didn't have one at all.
2026-07-10 10:49:18 -03:00
Daniel Arantes Loverde
4fc6a666b2 [cart-checkout] Fix delivery fee and address sync using stale cached profile
Cart's delivery fee and Checkout's address validation both fetched the
customer profile without forcing a cache refresh (2h TTL), then let that
possibly-stale address book unconditionally overwrite the just-picked
appState.address coordinates before building the fee/validation payload.
Result: changing the address on Home didn't reliably move the cart's
delivery fee, and Checkout's 'Alterar' could silently revert to the old
address when the stale coordinates made the backend report it as not
served.

Force-refresh the profile fetch and only use it to fill genuine gaps in
appState.address, never to override a live user selection.
2026-07-10 10:23:59 -03:00
380cd43657 Merge pull request 'WHAT! [ci-bitrise] Remove manage-ios-code-signing for good — no platform override exists' (#22) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#22
2026-07-09 18:53:43 -03:00
7a1a396557 Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 18:53:07 -03:00
Daniel Arantes Loverde
b151cd2659 [ci-bitrise] Remove manage-ios-code-signing for good — no platform override exists
Same failure again with platform: iOS set. Unlike xcode-archive@5's error
('Define the platform step input manually to avoid this phase in the
future'), this step's error gives no such hint — it has no override.
Confirmed twice now: this step cannot run on a target with
SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx. Back to relying
on xcode-archive@5's own automatic_code_signing: api-key alone.
2026-07-09 18:28:49 -03:00
447b7c7595 Merge pull request '[ci-bitrise] Restore manage-ios-code-signing with platform pinned instead of removed' (#21) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#21
2026-07-09 18:22:52 -03:00
455eeb048f Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 18:22:18 -03:00
Daniel Arantes Loverde
41bfc70171 [ci-bitrise] Restore manage-ios-code-signing with platform pinned instead of removed
Removing it earlier also removed the cert/profile provisioning it does
before archive — same mechanism LC Wallet's pipeline actually relies on.
The export failure ('No profiles for com.br.pedifoods.app were found',
'Cloud signing permission error') was that provisioning step missing,
not a Developer Portal or API key permission problem — both were already
confirmed fine. Should have looked for a platform override on this step
first, same as xcode-archive@5, instead of deleting it outright.
2026-07-09 18:13:54 -03:00
151cfcdd3d Merge pull request '[ci-bitrise] Pin xcode-archive platform input to skip broken auto-detect' (#20) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#20
2026-07-09 18:00:39 -03:00
f6a67fc42d Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 18:00:03 -03:00
Daniel Arantes Loverde
44726ce120 [ci-bitrise] Pin xcode-archive platform input to skip broken auto-detect
Same SDKROOT = auto issue as manage-ios-code-signing, this time inside
xcode-archive@5's own platform auto-detection. The step's log names the
fix itself: 'Define the platform step input manually to avoid this
phase in the future.'
2026-07-09 17:56:12 -03:00
1c5fac4fe5 Merge pull request '[ci-bitrise] Drop manage-ios-code-signing — can't parse this multi-platform target' (#19) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#19
2026-07-09 17:53:00 -03:00
3cb0a1bbf5 Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 17:51:31 -03:00
Daniel Arantes Loverde
9cf36527cd [ci-bitrise] Drop manage-ios-code-signing — can't parse this multi-platform target
Fails with 'no PLATFORM_DISPLAY_NAME config found for (PediFoods App)
target'. SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx on this
target (Skip's build) makes the step's platform detection ambiguous.
xcode-archive@5's own automatic_code_signing: api-key already handles
signing, so the step was redundant on top of being broken here.
2026-07-09 17:43:23 -03:00
6132530ee0 Agora vai?? 2026-07-09 17:37:52 -03:00
beaea42096 Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 17:37:31 -03:00
Daniel Arantes Loverde
6f04d9695b Update bitrise.yml 2026-07-09 17:34:25 -03:00
9a427d2e9f Merge pull request '[ci-bitrise] Fix agvtool cwd — Xcode project lives in Darwin/, not repo root' (#17) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#17
2026-07-09 17:32:16 -03:00
0d8eddc7e9 Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 17:32:07 -03:00
Daniel Arantes Loverde
c71ba2d2ac [ci-bitrise] Fix agvtool cwd — Xcode project lives in Darwin/, not repo root 2026-07-09 17:29:58 -03:00
1deae1f3bd Merge pull request 'fix/ci/apikey-json-escaping' (#16) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#16
2026-07-09 17:24:29 -03:00
7baed5ae4e Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 17:24:17 -03:00
Daniel Arantes Loverde
f94bf26bdc Update bitrise.yml 2026-07-09 17:23:13 -03:00
Daniel Arantes Loverde
0d9ebbd621 [ci-bitrise] Revert to fastlane-driven build — xcode-archive can't parse this project
xcode-archive@5 failed: 'unkown SDKROOT: auto'. Darwin/PediFoods.xcconfig
sets SDKROOT = auto and SUPPORTED_PLATFORMS = iphoneos iphonesimulator
macosx (Skip's multi-platform build target) — same root cause as the
earlier PLATFORM_DISPLAY_NAME failure from manage-ios-code-signing.
Both are Bitrise step-side project parsers that pre-guess a single
platform before invoking xcodebuild, and neither understands this
project's build shape.

xcodebuild itself has no problem with SDKROOT = auto (confirmed via a
local build). Only Bitrise's own step parsers choke on it. Going through
fastlane's build_app instead sidesteps that parser entirely — it's the
same approach the Darwin/fastlane/Fastfile already used before, restored
here with the earlier apikey.json JSON-escaping and DEVELOPMENT_TEAM
injection fixes kept.
2026-07-09 17:17:07 -03:00
cecd14f95a Merge pull request '[ci-bitrise] Drop manage-ios-code-signing, redundant with xcode-archive's automatic_code_signing' (#15) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#15
2026-07-09 17:12:10 -03:00
7edfc3268b Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 17:11:49 -03:00
Daniel Arantes Loverde
20e2ee3c38 [ci-bitrise] Drop manage-ios-code-signing, redundant with xcode-archive's automatic_code_signing
Step failed: 'no PLATFORM_DISPLAY_NAME config found for (PediFoods App)
target'. It queries build settings without pinning an SDK, and this
target's SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx (Skip
builds Darwin for both iOS and Catalyst-style macOS) makes that
ambiguous — LC Wallet's iOS-only target never hits this.

xcode-archive@5 already has automatic_code_signing: api-key, which
manages signing itself during archive. The separate step was redundant.
2026-07-09 17:07:09 -03:00
2e5cb19094 Merge pull request '[ci-bitrise] Drop dangling run_tests pipeline' (#14) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#14
2026-07-09 17:02:37 -03:00
da8f294aaa Merge branch 'main' into fix/ci/apikey-json-escaping 2026-07-09 17:01:14 -03:00
Daniel Arantes Loverde
2fda5ae747 [ci-bitrise] Drop dangling run_tests pipeline
Referenced build_for_testing/test_without_building workflows that were
never defined — copied the pipeline block from LC Wallet without its
matching workflow definitions. Unused anyway (not in trigger_map, no
PR trigger wanted), so removing instead of completing it.
2026-07-09 16:30:59 -03:00
45a89c2e72 Merge pull request 'Fix apikey.json generation to escape multi-line PEM content' (#13) from fix/ci/apikey-json-escaping into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#13
2026-07-09 16:29:13 -03:00
Daniel Arantes Loverde
5761523344 [ci-bitrise] Mirror LC Wallet's bitrise.yml structure exactly
Switch from fastlane-driven build (build_app + hand-rolled apikey.json)
to Bitrise's own xcode-archive step, matching LC Wallet 1:1: manage-ios-
code-signing + xcode-archive@5 (automatic_code_signing: api-key) do the
build/sign, deploy-to-itunesconnect-deliver@2 handles TestFlight in the
beta workflow, fastlane only runs for the release lane (metadata push +
App Store upload) reading BITRISE_IPA_PATH — same shape as LC Wallet's
Fastfile beta/release lanes.

Only genuine differences from LC Wallet, all forced by this project's
actual layout:
- BITRISE_PROJECT_PATH/SCHEME point at Darwin/PediFoods.xcodeproj
- fastlane work_dir is Darwin/ (Fastfile lives there, not repo root)
- build number bumps CURRENT_PROJECT_VERSION in Skip.env instead of
  agvtool — this project has no VERSIONING_SYSTEM set, Skip.env is the
  actual shared source of truth for both Darwin and Android
- team_id comes from a DEVELOPMENT_TEAM secret instead of a hardcoded
  literal — LC Wallet's Apple team ID isn't necessarily this app's
2026-07-09 16:24:23 -03:00
Daniel Arantes Loverde
74526d0fb9 [ci-bitrise] Fix apikey.json generation to escape multi-line PEM content
ASC_KEY_CONTENT is the raw .p8 private key, which contains literal
newlines. The heredoc interpolated it straight into a JSON string,
producing invalid JSON (JSON::ParserError in get_provisioning_profile).
Build the file with Ruby's JSON encoder instead so newlines are escaped
correctly. Verified locally against a realistic multi-line PEM value.
2026-07-09 16:21:02 -03:00
8cb0c57da6 Bitrise Test
Merge pull request 'Update ContentView.swift' (#12) from feature/ci/bitrise-setup into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#12
2026-07-09 15:53:16 -03:00
6218595355 Merge branch 'main' into feature/ci/bitrise-setup 2026-07-09 15:52:51 -03:00
Daniel Arantes Loverde
a2df5d5e7b Update ContentView.swift 2026-07-09 15:51:29 -03:00
a91086b187 Merge pull request '[ci-bitrise] Fix envs and versioning to match this project's actual config' (#10) from feature/ci/bitrise-setup into main
Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#10
2026-07-09 15:20:34 -03:00
289344a620 Merge branch 'main' into feature/ci/bitrise-setup 2026-07-09 15:19:57 -03:00