Skip to content

Resolve GitHub repo slug dynamically & add workflow artifact options#95

Open
cdavis-code wants to merge 1 commit into
ardera:mainfrom
cdavis-code:feat/dynamic-repo-resolution
Open

Resolve GitHub repo slug dynamically & add workflow artifact options#95
cdavis-code wants to merge 1 commit into
ardera:mainfrom
cdavis-code:feat/dynamic-repo-resolution

Conversation

@cdavis-code

Copy link
Copy Markdown

Summary

Replaces hardcoded GitHub repository slug defaults with dynamic resolution from the local git remote, and adds support for downloading engine artifacts from GitHub Actions workflow runs.

Changes

Dynamic repository resolution

  • lib/src/cache.dart: Add _resolveRepoSlugFromGit() helper that parses the git remote URL to determine the owner/repo dynamically. This replaces hardcoded gh.RepositorySlug('ardera', 'flutter-ci') defaults in GithubWorkflowRunArtifact, GithubReleaseArtifact, and FlutterpiCacheWithFlutterArtifacts factories.
  • If the repo cannot be determined, a clear error message is shown directing users to specify --github-artifacts-repo.

GitHub workflow artifact options

  • lib/src/cli/commands/build.dart: Add --github-artifacts-runid and --github-artifacts-repo options (hidden behind --verbose) for downloading engine binaries from specific GitHub Actions workflow runs.
  • lib/src/context.dart: Parse workflow args early in context initialization to support cache creation from CLI flags.
  • lib/src/executable.dart: Store raw command-line args before context initialization.

Bug fixes

  • lib/src/github.dart: URL-encode tag names in getReleaseByTagName to handle tags with special characters (e.g., engine/abc123).
  • lib/src/github.dart: Fix artifact total count parsing when GitHub API returns non-integer values for total_count.

Version bump

  • Bump version to 0.13.0 in pubspec.yaml
  • Add 0.13.0 entry to CHANGELOG.md

Verification

dart analyze reports no errors.

- Replace hardcoded repository slug defaults with git remote parsing
  in cache.dart, avoiding silent artifact fetches from the wrong repo
- Add --github-artifacts-runid and --github-artifacts-repo options to
  flutterpi_tool build for downloading engine binaries from GitHub
  Actions workflow runs
- Parse workflow args early in context initialization to support
  cache creation from CLI flags
- Fix URL encoding in getReleaseByTagName for tags with special chars
- Fix artifact total count parsing when GitHub API returns non-integer
- Bump version to 0.13.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant