Repository navigation
ci(shorebird): move code push to the Divine org and wire it into Codemagic #7202
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
dddde80
chore(shorebird): point code push at the Divine org app
NotThatKindOfDrLiz e273f68
ci(shorebird): cut store releases through Shorebird, add patch workflows
NotThatKindOfDrLiz 57ab834
ci(shorebird): require explicit confirmation before patching
NotThatKindOfDrLiz 910727a
docs(shorebird): document code push setup, constraints, and patch run…
NotThatKindOfDrLiz f729fb3
ci(shorebird): tighten patch workflow review fixes
NotThatKindOfDrLiz ae59542
ci(shorebird): harden release and patch safeguards
NotThatKindOfDrLiz 479a5f8
ci: budget CI configuration tests
NotThatKindOfDrLiz 78c8a37
ci(shorebird): block unsafe patch diffs
NotThatKindOfDrLiz 07ec75e
ci(shorebird): use Flutter 3.44.9 engine
NotThatKindOfDrLiz 5124ee1
ci(shorebird): preserve Flutter embedding for Android plugins
NotThatKindOfDrLiz 3ac15ba
ci(shorebird): remove plugin Flutter jar dependency
NotThatKindOfDrLiz 784ba72
ci(shorebird): keep Flutter jar dependency out of release
NotThatKindOfDrLiz 67cec33
ci(shorebird): fix caption generator debug test classpath
NotThatKindOfDrLiz 2a91d9f
ci(shorebird): harden release preflight
NotThatKindOfDrLiz 475c47e
ci(flutter): align workflow SDK pins
NotThatKindOfDrLiz e0bc138
ci(shorebird): close release hardening gaps
NotThatKindOfDrLiz a153223
ci(flutter): align post-rebase workflow pins
NotThatKindOfDrLiz d3cf2cc
docs(shorebird): record privacy disclosures
NotThatKindOfDrLiz ffb1ca8
ci(shorebird): harden cached release workflows
NotThatKindOfDrLiz a46851e
fix(shorebird): reject closed iOS release trains
NotThatKindOfDrLiz 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
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
244 changes: 237 additions & 7 deletions
244
.github/scripts/tests/test_codemagic_android_build_number.py
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,89 @@ | ||
| import json | ||
| import subprocess | ||
| import tempfile | ||
| import unittest | ||
| from pathlib import Path | ||
|
|
||
|
|
||
| SCRIPT_PATH = ( | ||
| Path(__file__).resolve().parents[3] | ||
| / "mobile" | ||
| / "scripts" | ||
| / "ios_store_version_preflight.rb" | ||
| ) | ||
|
|
||
|
|
||
| class IosStoreVersionPreflightTest(unittest.TestCase): | ||
| def run_preflight( | ||
| self, | ||
| payload: dict | list | str, | ||
| candidate_version: str = "1.0.21", | ||
| ) -> subprocess.CompletedProcess[str]: | ||
| with tempfile.NamedTemporaryFile(mode="w", suffix=".json") as file: | ||
| json.dump(payload, file) | ||
| file.flush() | ||
| return subprocess.run( | ||
| ["ruby", str(SCRIPT_PATH), file.name, candidate_version], | ||
| check=False, | ||
| text=True, | ||
| capture_output=True, | ||
| ) | ||
|
|
||
| def test_allows_version_above_latest_approved_version(self) -> None: | ||
| result = self.run_preflight( | ||
| {"buildId": "build-id", "version": "1.0.20", "buildNumber": "848"} | ||
| ) | ||
|
|
||
| self.assertEqual(result.returncode, 0, result.stderr) | ||
| self.assertIn("newer than approved App Store version 1.0.20", result.stdout) | ||
|
|
||
| def test_blocks_same_version_as_latest_approved_version(self) -> None: | ||
| result = self.run_preflight( | ||
| {"buildId": "build-id", "version": "1.0.20", "buildNumber": "848"}, | ||
| candidate_version="1.0.20", | ||
| ) | ||
|
|
||
| self.assertNotEqual(result.returncode, 0) | ||
| self.assertIn("must be newer than approved App Store version 1.0.20", result.stderr) | ||
|
|
||
| def test_blocks_version_below_latest_approved_version(self) -> None: | ||
| result = self.run_preflight( | ||
| {"buildId": "build-id", "version": "1.2.0", "buildNumber": "848"}, | ||
| candidate_version="1.1.99", | ||
| ) | ||
|
|
||
| self.assertNotEqual(result.returncode, 0) | ||
| self.assertIn("must be newer than approved App Store version 1.2.0", result.stderr) | ||
|
|
||
| def test_compares_numeric_components_instead_of_lexically(self) -> None: | ||
| result = self.run_preflight( | ||
| {"buildId": "build-id", "version": "1.9.9", "buildNumber": "848"}, | ||
| candidate_version="1.10.0", | ||
| ) | ||
|
|
||
| self.assertEqual(result.returncode, 0, result.stderr) | ||
|
|
||
| def test_fails_closed_on_missing_version(self) -> None: | ||
| result = self.run_preflight({"buildId": "build-id", "buildNumber": "848"}) | ||
|
|
||
| self.assertNotEqual(result.returncode, 0) | ||
| self.assertIn("missing version", result.stderr) | ||
|
|
||
| def test_fails_closed_on_invalid_json_shape(self) -> None: | ||
| result = self.run_preflight([]) | ||
|
|
||
| self.assertNotEqual(result.returncode, 0) | ||
| self.assertIn("expected a JSON object", result.stderr) | ||
|
|
||
| def test_fails_closed_on_invalid_version(self) -> None: | ||
| result = self.run_preflight( | ||
| {"buildId": "build-id", "version": "1.0.20", "buildNumber": "848"}, | ||
| candidate_version="next", | ||
| ) | ||
|
|
||
| self.assertNotEqual(result.returncode, 0) | ||
| self.assertIn("invalid candidate version", result.stderr) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.