Add deleted files feature based on commit, also improving user experience on buld and export step - #4
Add deleted files feature based on commit, also improving user experience on buld and export step#4Oktavian19 wants to merge 4 commits into
Conversation
… in git service and UI
… logic, and validation tests
There was a problem hiding this comment.
🟡 Changes recommended
There are correctness and safety issues in deleted-file handling (git output parsing/ordering and unsafe shell script generation) plus brittle version assertions that will break as soon as releases advance.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds support for tracking and packaging deleted files (via a generated delete_files.sh), improves the export/build step UX (including skipping the build step when disabled), introduces per-project export destination persistence, and adds release automation/versioning infrastructure (release-please + versioned Windows artifacts).
Changes:
- Track file change types (added/modified/deleted) from selected commits and generate a deletion script during export.
- Improve stepper UX by moving the build toggle earlier and making the flow conditional when build is disabled.
- Add release-please automation + version extraction in GitHub Actions, with supporting docs/tests.
File summaries
| File | Description |
|---|---|
| test/yaml_workflow_test.dart | Adds YAML validity checks and version/manifest assertions for CI/release config. |
| test/widget_test.dart | Replaces TODO with a minimal placeholder test to keep test suite non-empty. |
| test/settings_service_test.dart | Tests per-project export path persistence in SettingsService. |
| test/export_service_test.dart | Tests deleted-file handling, delete script generation, and export skipping deleted files. |
| README.md | Documents SemVer + release-please workflow. |
| pubspec.yaml | Adds yaml as a dev dependency to support YAML parsing tests. |
| pubspec.lock | Updates lockfile (including making yaml a direct dev dependency) and SDK constraints. |
| lib/widgets/step_project_picker.dart | Moves build-toggle UI into the project selection step. |
| lib/widgets/step_export.dart | Updates export summary/success UI to account for deleted files and per-project destination defaults. |
| lib/widgets/step_changed_files.dart | Adds per-status counts (added/modified/deleted) and deleted-file styling/badges in the list UI. |
| lib/widgets/step_build_config.dart | Simplifies build config UI now that enable/disable toggle moved earlier in flow. |
| lib/widgets/diff_viewer_dialog.dart | Adds a banner when viewing diffs for deleted files. |
| lib/services/settings_service.dart | Adds per-project export path storage with fallback to global export path. |
| lib/services/git_service.dart | Enhances changed-files detection to include change types and deleted files across commits. |
| lib/services/export_service.dart | Adds delete-script generation and updates export to skip deleted files while reporting them. |
| lib/providers/app_providers.dart | Persists export destination per project, generates delete script during export, and wires project changes into export state. |
| lib/pages/deploy_packager_page.dart | Makes step labels/icons and step content conditional on build being enabled. |
| lib/models/diff_result.dart | Extends diff model with isDeleted. |
| lib/models/changed_file.dart | Introduces FileChangeType and change-type helpers, updating equality/hash semantics. |
| CHANGELOG.md | Adds an initial Keep a Changelog file for release-please management. |
| analysis_options.yaml | Excludes platform/build folders from analyzer to reduce noise. |
| .release-please-manifest.json | Adds release-please manifest with the initial version. |
| .github/workflows/release-please.yaml | Adds release-please workflow on pushes to main. |
| .github/workflows/build-windows.yaml | Extracts SemVer from pubspec and version-stamps the uploaded artifact. |
| .github/workflows/build-windows-installer.yaml | Extracts version and version-stamps installer output/artifact. |
| .github/release-please-config.json | Adds release-please config for Dart releases + changelog sections. |
Review details
Suppressed comments (1)
lib/services/git_service.dart:96
git diff-tree --name-statusoutput is tab-delimited; splitting on whitespace breaks filenames containing spaces (and can change the exact path when re-joining). Parse using\tto preserve paths exactly, including for renames.
final parts = trimmed.split(RegExp(r'\s+'));
if (parts.isEmpty) continue;
final statusCode = parts[0];
- Files reviewed: 25/26 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| final buffer = StringBuffer(); | ||
| buffer.writeln('#!/bin/bash'); | ||
| buffer.writeln('# Auto-generated by Deploy Packager'); | ||
| buffer.writeln('# Run this script in the root deployment folder on your server.'); | ||
| buffer.writeln(); | ||
| buffer.writeln('echo "Deleting ${deletedFiles.length} removed file(s)..."'); | ||
| for (final file in deletedFiles) { | ||
| buffer.writeln('rm -f "${file.relativePath}"'); | ||
| } |
| // Order commits chronologically (oldest to newest) | ||
| final orderRes = await Process.run( | ||
| 'git', | ||
| ['log', '--reverse', '--format=%H', '--no-walk', ...commitHashes], | ||
| workingDirectory: projectPath, | ||
| runInShell: Platform.isWindows, | ||
| ); | ||
|
|
||
| final orderedHashes = orderRes.exitCode == 0 && (orderRes.stdout as String).trim().isNotEmpty | ||
| ? (orderRes.stdout as String).trim().split('\n').map((h) => h.trim()).toList() | ||
| : commitHashes; | ||
|
|
| ), | ||
| ), | ||
| if (widget.result.skippedFiles > 0) ...[ | ||
| if (res.deletedFilesCount > 0) ...[ |
| expect(ver, equals('1.0.0+1')); | ||
| expect(semver, equals('1.0.0')); | ||
| expect(build, equals('1')); |
|
|
||
| This project uses [Semantic Versioning](https://semver.org/) (`MAJOR.MINOR.PATCH`) with automated releases via [release-please](https://github.com/googleapis/release-please). | ||
|
|
||
| - **Source of truth:** `pubspec.yaml:4` (`version: 1.0.0+1` — `+1` is the Android/Windows build number). |
CHANGE DETAIL
User can export deleted_files.sh and run it at the server so it will automatically delete the deleted files (based on commit).
Move the build toggle into the first step and save path on export step
I'm also add some kind of automatic versioning that i never use before so let this project be my lab rat ;)