chore: Add GitHub Copilot configuration file (#3073)#3079
chore: Add GitHub Copilot configuration file (#3073)#3079moksha-hub wants to merge 224 commits intofossasia:developmentfrom
Conversation
Co-authored-by: Anashuman Singh <anash.cheema@gmail.com>
Co-authored-by: Anashuman Singh <125425881+AsCress@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marc Nause <marc.nause@audioattack.de>
Co-authored-by: Marc Nause <marc.nause@audioattack.de>
…improve BH1750 schematic (fossasia#3041) Co-authored-by: Marc Nause <marc.nause@audioattack.de>
Bumps [org.jetbrains.kotlin.android](https://github.com/JetBrains/kotlin) from 2.3.0 to 2.3.10. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](JetBrains/kotlin@v2.3.0...v2.3.10) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin.android dependency-version: 2.3.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Add copilot-instructions.md to customize GitHub Copilot responses for the PSLab project. This provides context about: - Project overview and technology stack - Code style guidelines - Architecture patterns (BLoC, separation of concerns) - Testing requirements - Documentation standards Fixes fossasia#3073
|
Hi, a process note. We have automatic Copilot PR reviews enabled on this repository. These reviews are only triggered if the contributor has GitHub Copilot enabled and an active license on their own account. Please enable Copilot in your GitHub settings if you have access. In many regions, free licenses are available through educational institutions or developer programs. Enabling Copilot helps us speed up the auto review process and reduces manual review overhead for the core team. |
There was a problem hiding this comment.
Pull request overview
This PR introduces project-level GitHub Copilot instructions and simultaneously reflects a major restructure/migration of the Android codebase toward a Flutter-based project layout, including updated CI workflows and build configurations.
Changes:
- Added
.github/copilot-instructions.mdwith PSLab-specific Copilot guidelines. - Replaced legacy
app/Android module sources with Flutter-styleandroid/project structure and a newMainActivityFlutter embedding entrypoint. - Overhauled GitHub Actions workflows (PR builds, releases, screenshots, Dependabot) for multi-platform Flutter CI/CD.
Reviewed changes
Copilot reviewed 113 out of 968 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/java/io/pslab/communication/sensors/MPU6050.java | Removed legacy Android sensor driver (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/MLX90614.java | Removed legacy Android sensor driver (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/KalmanFilter.java | Removed legacy filtering utility (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/HMC5883L.java | Removed legacy Android sensor driver (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/ComplementaryFilter.java | Removed legacy filtering utility (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/CCS811.java | Removed legacy Android sensor driver (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/BMP180.java | Removed legacy Android sensor driver (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/BH1750.java | Removed legacy Android sensor driver (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/ADS1115.java | Removed legacy Android sensor driver (legacy module removal). |
| app/src/main/java/io/pslab/communication/sensors/AD9833.java | Removed legacy peripheral driver (legacy module removal). |
| app/src/main/java/io/pslab/communication/peripherals/SPI.java | Removed legacy peripheral abstraction (legacy module removal). |
| app/src/main/java/io/pslab/communication/peripherals/RadioLink.java | Removed legacy peripheral abstraction (legacy module removal). |
| app/src/main/java/io/pslab/communication/peripherals/MCP4728.java | Removed legacy peripheral abstraction (legacy module removal). |
| app/src/main/java/io/pslab/communication/peripherals/I2C.java | Removed legacy peripheral abstraction (legacy module removal). |
| app/src/main/java/io/pslab/communication/peripherals/DACChannel.java | Removed legacy peripheral abstraction (legacy module removal). |
| app/src/main/java/io/pslab/communication/digitalChannel/DigitalChannel.java | Removed legacy logic analyzer/digital channel code (legacy module removal). |
| app/src/main/java/io/pslab/communication/analogChannel/AnalogInputSource.java | Removed legacy analog input utilities (legacy module removal). |
| app/src/main/java/io/pslab/communication/analogChannel/AnalogConstants.java | Removed legacy analog constants (legacy module removal). |
| app/src/main/java/io/pslab/communication/analogChannel/AnalogAquisitionChannel.java | Removed legacy analog acquisition logic (legacy module removal). |
| app/src/main/java/io/pslab/communication/SensorList.java | Removed legacy sensor lookup table (legacy module removal). |
| app/src/main/java/io/pslab/communication/PacketHandler.java | Removed legacy packet/transport code (legacy module removal). |
| app/src/main/java/io/pslab/communication/HttpHandler.java | Removed legacy HTTP transport code (legacy module removal). |
| app/src/main/java/io/pslab/communication/HttpAsyncTask.java | Removed legacy async HTTP wrapper (legacy module removal). |
| app/src/main/java/io/pslab/communication/CommunicationHandler.java | Removed legacy USB serial communication code (legacy module removal). |
| app/src/main/java/io/pslab/communication/CommandsProto.java | Removed legacy command protocol constants (legacy module removal). |
| app/src/main/java/io/pslab/adapters/OscilloscopeMeasurementsAdapter.java | Removed legacy Android UI adapter (legacy module removal). |
| app/src/main/java/io/pslab/adapters/MPUDataAdapter.java | Removed legacy Android UI adapter (legacy module removal). |
| app/src/main/java/io/pslab/adapters/CheckBoxAdapter.java | Removed legacy Android UI adapter (legacy module removal). |
| app/src/main/java/io/pslab/adapters/ApplicationAdapter.java | Removed legacy Android UI adapter (legacy module removal). |
| app/src/main/java/io/pslab/activity/guide/GuideActivity.java | Removed legacy guide activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/ThermometerActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/SplashActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/SoundMeterActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/ShowLoggedData.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/SettingsActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/SensorActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/MapsActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/LuxMeterActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/LogicalAnalyzerActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/GyroscopeActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/GasSensorActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/DustSensorActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/CreateConfigActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/ControlActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/CompassActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/BarometerActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/activity/AccelerometerActivity.java | Removed legacy Android activity (legacy module removal). |
| app/src/main/java/io/pslab/SearchModel.java | Removed legacy model (legacy module removal). |
| app/src/main/java/io/pslab/PSLabApplication.java | Removed legacy Application class (legacy module removal). |
| app/src/main/java/io/pslab/InputMinMaxFilter.java | Removed legacy input filter utility (legacy module removal). |
| app/src/main/java/io/pslab/DataFormatter.java | Removed legacy formatting utility (legacy module removal). |
| app/src/main/java/io/pslab/CheckBoxGetter.java | Removed legacy model (legacy module removal). |
| app/src/main/AndroidManifest.xml | Removed legacy Android manifest (moved to Flutter android/ structure). |
| app/proguard-rules.pro | Removed legacy ProGuard rules file (legacy module removal). |
| app/build.gradle.kts | Removed legacy Android module Gradle build file (migrated to Flutter android/). |
| app/.gitignore | Removed legacy module gitignore entry. |
| android/settings.gradle | Added Flutter/Gradle plugin management and plugin versions. |
| android/gradle/wrapper/gradle-wrapper.properties | Updated Gradle wrapper distribution. |
| android/gradle.properties | Added AndroidX/Jetifier and Gradle JVM args. |
| android/build.gradle | Added Flutter-style root Android build script. |
| android/app/src/profile/AndroidManifest.xml | Added Flutter profile manifest (INTERNET perm for tooling). |
| android/app/src/main/res/values/styles.xml | Added Flutter embedding launch/normal themes. |
| android/app/src/main/res/values-night/styles.xml | Added dark-mode launch/normal themes. |
| android/app/src/main/res/drawable/launch_background.xml | Added launch background drawable. |
| android/app/src/main/res/drawable-v21/launch_background.xml | Added v21 launch background drawable. |
| android/app/src/main/java/io/pslab/MainActivity.java | Added FlutterActivity host + native temperature sensor bridge (MethodChannel/EventChannel). |
| android/app/src/main/AndroidManifest.xml | Added Flutter app manifest with permissions/features/queries. |
| android/app/src/debug/AndroidManifest.xml | Added debug manifest (INTERNET perm for hot reload/debugging). |
| android/app/build.gradle | Added Flutter Android app Gradle build script + signing logic. |
| android/.gitignore | Added Flutter Android project gitignore entries. |
| analysis_options.yaml | Added Dart analyzer configuration (flutter_lints). |
| .metadata | Added Flutter project metadata (tool-managed). |
| .github/workflows/semantic_lint.yml | Added semantic PR title validation workflow. |
| .github/workflows/release.yml | Updated release workflow for new repo name, secrets, and fastlane branches. |
| .github/workflows/pull-request.yml | Updated PR workflow for Flutter multi-platform builds and screenshot jobs. |
| .github/workflows/pull-request-closed.yml | Added workflow to delete PR screenshots on PR close. |
| .github/workflows/flutter_upgrade.yml | Added scheduled workflow to check/update Flutter version in pubspec. |
| .github/workflows/clean-screenshots.yml | Added scheduled workflow to clean screenshots for closed PRs. |
| .github/dependabot.yml | Updated Dependabot config for pub/gradle/actions with daily cadence. |
| .github/copilot-instructions.md | Added GitHub Copilot response guidelines for PSLab. |
| .github/actions/windows/action.yml | Added composite action for Windows build + installer packaging. |
| .github/actions/screenshot-iphone/action.yml | Added composite action for iPhone screenshot generation. |
| .github/actions/screenshot-ipad/action.yml | Added composite action for iPad screenshot generation. |
| .github/actions/screenshot-android/action.yml | Added composite action for Android emulator screenshots. |
| .github/actions/macos/action.yml | Added composite action for macOS build + dmg packaging. |
| .github/actions/linux/action.yml | Added composite action for Linux build + deb/rpm packaging. |
| .github/actions/ios/action.yml | Added composite action for iOS ipa build (with/without signing). |
| .github/actions/common/action.yml | Added composite action for shared Flutter formatting/analyze/test steps. |
| .github/actions/android/action.yml | Added composite action for Android Flutter builds + artifact upload. |
| .github/PULL_REQUEST_TEMPLATE | Updated PR template wording/checklist for Flutter workflows. |
| .github/ISSUE_TEMPLATE/report-a-bug.md | Added structured bug report issue template. |
| .github/ISSUE_TEMPLATE/general-issues.md | Added general-issue template. |
| .github/ISSUE_TEMPLATE/feature_request.md | Added feature request template. |
| .github/ISSUE_TEMPLATE | Removed legacy unstructured issue template file. |
| LICENSE | Removed license file from repository root. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - name: Read Flutter version from pubspec.yaml | ||
| id: read-version | ||
| run: | |
There was a problem hiding this comment.
This step assumes yq is available on the GitHub-hosted runner, but it isn’t guaranteed to be installed by default. Install yq (and fail fast if missing), or parse pubspec.yaml using a tool that’s already present (e.g., a small Dart script) to prevent the scheduled workflow from failing immediately.
| run: | | |
| run: | | |
| if ! command -v yq >/dev/null 2>&1; then | |
| echo "yq not found, installing..." | |
| sudo curl -L "https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64" -o /usr/local/bin/yq | |
| sudo chmod +x /usr/local/bin/yq | |
| fi |
| directories: | ||
| - "/.github/workflows" | ||
| - "/.github/actions/android" | ||
| - "/.github/actions/common" | ||
| - "/.github/actions/ios" | ||
| - "/.github/actions/screenshot-android" | ||
| schedule: |
There was a problem hiding this comment.
Dependabot configuration typically supports directory (singular) per update entry; directories is likely not a valid key and may cause Dependabot to ignore this configuration. If you intend to scan multiple directories, split this into multiple github-actions update entries, each with its own directory, or use the supported multi-directory syntax if you’ve confirmed it’s available for your Dependabot version.
| directories: | |
| - "/.github/workflows" | |
| - "/.github/actions/android" | |
| - "/.github/actions/common" | |
| - "/.github/actions/ios" | |
| - "/.github/actions/screenshot-android" | |
| schedule: | |
| directory: "/.github/workflows" | |
| schedule: | |
| interval: "daily" | |
| - package-ecosystem: "github-actions" | |
| directory: "/.github/actions/android" | |
| schedule: | |
| interval: "daily" | |
| - package-ecosystem: "github-actions" | |
| directory: "/.github/actions/common" | |
| schedule: | |
| interval: "daily" | |
| - package-ecosystem: "github-actions" | |
| directory: "/.github/actions/ios" | |
| schedule: | |
| interval: "daily" | |
| - package-ecosystem: "github-actions" | |
| directory: "/.github/actions/screenshot-android" | |
| schedule: |
| - name: Push version to production (Android) | ||
| run: | | ||
| cd ./android | ||
| fastlane promoteToProduction version_code:${{ steps.download-assets.outputs.VERSION_CODE }} | ||
| if [[ $? -ne 0 ]]; then |
There was a problem hiding this comment.
The workflow invokes fastlane but no longer sets up Ruby / installs Fastlane (the previous Ruby/Bundler steps were removed). Unless Fastlane is preinstalled on the runner (not guaranteed), this will fail at runtime. Add an explicit Fastlane installation step (e.g., via ruby/setup-ruby + gem install fastlane or Bundler) before using it.
| - name: Update Fastlane Metadata (iOS) | ||
| run: | | ||
| cd ./iOS | ||
| git clone --branch=fastlane-ios --depth=1 https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} fastlane |
There was a problem hiding this comment.
This step uses cd ./iOS. Flutter’s default directory is typically ios/ (lowercase), and on Linux runners paths are case-sensitive. If the repo uses ios/, this will fail. Use the correct directory name consistently (and match the actual repo layout).
| if (currentTemperature != 0.0f && temperatureEventSink != null) { | ||
| Log.d(TAG, "Sending initial temperature to Flutter: " + currentTemperature); | ||
| temperatureEventSink.success((double) currentTemperature); | ||
| } | ||
|
|
There was a problem hiding this comment.
Using currentTemperature != 0.0f as a proxy for “has a reading” drops valid initial readings of exactly 0°C. Track a separate hasTemperatureReading flag (or initialize currentTemperature to Float.NaN and check !Float.isNaN(...)) so a valid 0°C value is still sent.
| case "isTemperatureSensorAvailable": | ||
| result.success(temperatureSensor != null); | ||
| break; | ||
| case "getCurrentTemperature": | ||
| result.success((double) currentTemperature); | ||
| break; |
There was a problem hiding this comment.
getCurrentTemperature always returns a numeric value even when the sensor is unavailable or before any reading is received (defaulting to 0.0). This can mislead Dart-side consumers. Consider returning an error if the sensor is unavailable, or returning null/a sentinel until the first valid reading arrives.
Summary
This PR adds a GitHub Copilot configuration file to customize Copilot's responses for the PSLab project.
Changes
.github/copilot-instructions.mdwith project-specific guidelinesContent
The configuration file provides Copilot with context about:
This helps ensure Copilot provides more relevant code suggestions and reviews that align with the project's standards.
Fixes #3073