-
-
Notifications
You must be signed in to change notification settings - Fork 12
WIP: OBLS-837 Add discrete picking order list screen #430
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
Draft
jmiranda
wants to merge
12
commits into
develop
Choose a base branch
from
OBLS-837
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f4c59ea
OBLS-837 Add discrete picking order list screen
claude 8e571de
OBLS-837 Enable Appetize previews for PRs into develop
claude 87d4c08
OBLS-837 Use appetize-deploy public_key input for shared preview app
claude 2a34ae4
OBLS-837 Revert appetize-deploy to known-good config (drop public_key)
claude adc6a11
OBLS-837 Route Appetize deploys to per-build-type apps
claude a4ce476
OBLS-837 Add Appetize app public keys to bitrise env
claude aff1cfd
OBLS-837 Harden Appetize app-select script against unset vars
claude f55d501
OBLS-837 Tag PR preview builds as experimental in the app name
claude dc555ee
OBLS-837 Give PR builds a distinct applicationId for Appetize
claude 4cc943b
OBLS-837 Point PR builds at the dedicated Appetize preview app
claude 7fb5957
OBLS-837 Auto-set Appetize note with build context
claude a41d6a2
OBLS-837 Address review: surface error message; drop jq dependency
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,8 @@ trigger_map: | |
| workflow: android-only | ||
| - push_branch: master | ||
| workflow: app_distribution_to_uat_testers | ||
| # Build a preview (APK + Appetize deploy) for every pull request into develop. | ||
| - pull_request_target_branch: develop | ||
| enabled: false | ||
| workflow: android-only | ||
| - pull_request_source_branch: "*" | ||
| enabled: false | ||
|
|
@@ -133,10 +133,57 @@ step_bundles: | |
| - notify_email_list: "$TESTERS" | ||
| - notify_user_groups: owner, admins, developers | ||
| is_always_run: false | ||
| # Pick which Appetize app to deploy to based on build type: PR builds go to | ||
| # the PR preview app, everything else (e.g. develop push) to the main app. | ||
| # BITRISE_PULL_REQUEST is set (to the PR number) only on pull request builds. | ||
| - script@1: | ||
| title: Select Appetize app by build type | ||
| inputs: | ||
| - content: |- | ||
| set -euo pipefail | ||
| if [ -n "${BITRISE_PULL_REQUEST:-}" ]; then | ||
| echo "PR build - deploying to PR preview app" | ||
| envman add --key APPETIZE_PUBLIC_KEY --value "${APPETIZE_PR_PUBLIC_KEY:-}" | ||
| else | ||
| echo "Push build - deploying to main app" | ||
| envman add --key APPETIZE_PUBLIC_KEY --value "${APPETIZE_DEVELOP_PUBLIC_KEY:-}" | ||
| fi | ||
| - appetize-deploy@0: | ||
| # Skip the deploy when no target app key is configured, so we never fall | ||
| # back to creating a new app (which would overwrite the main app). | ||
| run_if: '{{enveq "APPETIZE_PUBLIC_KEY" "" | not}}' | ||
| inputs: | ||
| - app_path: $BITRISE_DEPLOY_DIR/openboxes_test_b$BITRISE_BUILD_NUMBER.apk | ||
| - appetize_token: $APPETIZE_API_TOKEN | ||
| - public_key: $APPETIZE_PUBLIC_KEY | ||
| # Annotate the deployed Appetize app with build context (PR/branch/commit). | ||
| # The appetize-deploy step can't set a note, so call the v1 API directly. | ||
| # v1 supports "note" but not "tags"; failures here are non-fatal. | ||
| - script@1: | ||
| title: Set Appetize note with build context | ||
| run_if: '{{enveq "APPETIZE_PUBLIC_KEY" "" | not}}' | ||
| inputs: | ||
| - content: |- | ||
| set -euo pipefail | ||
| SHA="${BITRISE_GIT_COMMIT:-}" | ||
| SHA="${SHA:0:8}" | ||
| if [ -n "${BITRISE_PULL_REQUEST:-}" ]; then | ||
| NOTE="PR #${BITRISE_PULL_REQUEST} - ${BITRISE_GIT_BRANCH:-} - ${SHA} - build ${BITRISE_BUILD_NUMBER:-}" | ||
| else | ||
| NOTE="${BITRISE_GIT_BRANCH:-} - ${SHA} - build ${BITRISE_BUILD_NUMBER:-}" | ||
| fi | ||
| # Build the JSON body without jq (which may be skipped) so this step | ||
| # is self-contained. Escape backslashes and double quotes for JSON. | ||
| ESCAPED="$(printf '%s' "$NOTE" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')" | ||
| BODY="{\"note\":\"${ESCAPED}\"}" | ||
| if curl -fsS -X POST "https://api.appetize.io/v1/apps/${APPETIZE_PUBLIC_KEY}" \ | ||
| -H "X-API-KEY: ${APPETIZE_API_TOKEN}" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "$BODY" > /dev/null; then | ||
| echo "Set Appetize note: ${NOTE}" | ||
| else | ||
| echo "Warning: failed to set Appetize note (non-fatal)" | ||
| fi | ||
| release-steps-android-signed: | ||
| description: |- | ||
| Assemble the Android app and copy the signed APK to $BITRISE_DEPLOY_DIR. | ||
|
|
@@ -229,6 +276,26 @@ workflows: | |
| - bundle::setup-steps: {} | ||
| - bundle::setup-steps-android: {} | ||
| - bundle::branding: {} | ||
| # On PR builds only, mark the build as experimental: append "(Experimental)" | ||
| # to the app name AND give it a distinct applicationId. Appetize keys apps by | ||
| # applicationId, so the suffix makes the PR build a separate Appetize app | ||
| # (its own URL) instead of overwriting the stable app. Runs after branding | ||
| # (which sets app_name) and before the release assemble. | ||
| - script@1: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this could be a part of |
||
| title: Mark PR builds as experimental (name + applicationId) | ||
| run_if: '{{getenv "BITRISE_PULL_REQUEST" | ne ""}}' | ||
| inputs: | ||
| - content: |- | ||
| set -euo pipefail | ||
| STRINGS_FILE="android/app/src/main/res/values/strings.xml" | ||
| GRADLE_FILE="android/app/build.gradle" | ||
| sed -i.bak -E 's#(<string name="app_name">)([^<]*)(</string>)#\1\2 (Experimental)\3#' "$STRINGS_FILE" | ||
| rm -f "$STRINGS_FILE.bak" | ||
| sed -i.bak -E 's#(applicationId "com\.openboxes\.android)(")#\1.experimental\2#' "$GRADLE_FILE" | ||
| rm -f "$GRADLE_FILE.bak" | ||
| echo "app_name and applicationId are now:" | ||
| grep app_name "$STRINGS_FILE" | ||
| grep applicationId "$GRADLE_FILE" | ||
| - bundle::release-steps-android: {} | ||
| triggers: | ||
| enabled: false | ||
|
|
@@ -283,6 +350,17 @@ app: | |
| - opts: | ||
| is_expand: false | ||
| VARIANT: staging | ||
| # Appetize app public keys (from the app's share URL: appetize.io/app/<key>). | ||
| # These are not secrets. The main app is used by develop; PR builds deploy to a | ||
| # separate PR preview app. Leave APPETIZE_PR_PUBLIC_KEY empty until the PR | ||
| # preview app exists — the appetize-deploy run_if guard skips the deploy while | ||
| # it is empty, so PR builds never overwrite the main app. | ||
| - opts: | ||
| is_expand: false | ||
| APPETIZE_DEVELOP_PUBLIC_KEY: 67t5r4akxrtgvujo7adbiifau4 | ||
| - opts: | ||
| is_expand: false | ||
| APPETIZE_PR_PUBLIC_KEY: "b_wchsvah7t6ytekpcvd2pvqavty" | ||
|
|
||
| meta: | ||
| bitrise.io: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import React from 'react'; | ||
| import { StyleSheet, View } from 'react-native'; | ||
| import { Card } from 'react-native-paper'; | ||
|
|
||
| import { ShimmerBlock, SkeletonDivider } from '../../components/ContentSkeleton'; | ||
| import Theme from '../../utils/Theme'; | ||
|
|
||
| export default function DiscretePickingCardSkeleton() { | ||
| return ( | ||
| <View style={styles.wrapper}> | ||
| <Card style={styles.card}> | ||
| <Card.Content> | ||
| <View style={styles.headerRow}> | ||
| <ShimmerBlock style={styles.orderNumber} /> | ||
| <ShimmerBlock style={styles.statusChip} /> | ||
| </View> | ||
| <SkeletonDivider /> | ||
| <ShimmerBlock style={styles.destination} /> | ||
| <View style={styles.metaRow}> | ||
| <ShimmerBlock style={styles.metaChip} /> | ||
| <ShimmerBlock style={styles.metaChip} /> | ||
| </View> | ||
| </Card.Content> | ||
| </Card> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| wrapper: { | ||
| marginHorizontal: Theme.spacing.medium, | ||
| marginBottom: Theme.spacing.small - 2 | ||
| }, | ||
| card: { | ||
| borderRadius: Theme.roundness, | ||
| backgroundColor: 'white', | ||
| borderWidth: 1, | ||
| borderColor: '#ddd' | ||
| }, | ||
| headerRow: { | ||
| flexDirection: 'row', | ||
| justifyContent: 'space-between', | ||
| alignItems: 'center', | ||
| marginBottom: Theme.spacing.small - 2 | ||
| }, | ||
| orderNumber: { width: 140, height: 22, borderRadius: 4 }, | ||
| statusChip: { width: 90, height: 24, borderRadius: Theme.roundness }, | ||
| destination: { width: '70%', height: 16, borderRadius: 4, marginTop: 6 }, | ||
| metaRow: { flexDirection: 'row', marginTop: Theme.spacing.small }, | ||
| metaChip: { width: 90, height: 24, borderRadius: Theme.roundness, marginRight: Theme.spacing.small } | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will now trigger a build on each PR to the develop branch. Do we want to have it? I think I'd prefer to have a different approach here. I'd make a preview build when the code is pushed to the
preview/*branch (or something like that). Not everything (eg a commit with a typo fix after review) needs a publish to Appetize and to be sent out to Bitrise build recipients. Plus, not that long ago we ran into a credits limit due to building on each PR to develop.