Skip to content

Adding github actions for PRs#4

Closed
arnavjosh wants to merge 76 commits intoQuali-1from
github-workflows
Closed

Adding github actions for PRs#4
arnavjosh wants to merge 76 commits intoQuali-1from
github-workflows

Conversation

@arnavjosh
Copy link
Copy Markdown
Member

Before issuing a pull request, please see the contributing page.

tango8 and others added 30 commits October 1, 2025 08:50
- added Artifact array to keep track of what colors are in which positions
- added stateToColor()
- added scanArtifact()
- added enum ArtifactColor
- added shiftArtifacts()
- added moveToColor()
- edited moveTo() to yield the thread until the servo finishes turning
…m the array if the ramp actuator is activated
…ent-fixes

# Conflicts:
#	TeamCode/src/main/java/org/firstinspires/ftc/teamcode/testing/AprilTagTester.java
…e, optimizations to hopefully get cleaner autoaim
…on control class to help us move to certian positons using CR Servo the control class is PIDF vibe code so dont expect it to work first time
…on control class to help us move to certian positons using CR Servo the control class is PIDF vibe code so dont expect it to work first time
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds three GitHub Actions workflows to automate code quality checks for pull requests and pushes to the Quali-1 branch. The workflows provide continuous integration capabilities including static analysis, code formatting validation, and build/lint/test automation.

Key changes:

  • SpotBugs static analysis workflow for the TeamCode module
  • Google Java Format validation for Java source files in TeamCode
  • Comprehensive CI workflow that builds, lints, and tests the project

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.

File Description
.github/workflows/spotbugs-teamcode.yml Adds SpotBugs static analysis workflow with intelligent task detection for Android/Gradle projects
.github/workflows/format-java.yml Adds Google Java Format validation workflow to ensure consistent code formatting
.github/workflows/ci.yml Adds main CI workflow for building, linting, and testing the FTC robot controller project

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
- "gradle.properties"
- "gradlew"
- "gradlew.bat"
- ".github/workflows/**"
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path filter '.github/workflows/**' will trigger this workflow when any workflow file changes. This could cause unnecessary CI runs when unrelated workflows are modified. Consider being more specific about which workflow changes should trigger the full CI build, or remove this path if changes to workflows should always trigger CI validation.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/format-java.yml Outdated
Comment on lines +30 to +34
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow sets up JDK 17, but TeamCode/build.gradle specifies Java 16 for sourceCompatibility/targetCompatibility and Java 21 for the toolchain. This version mismatch could lead to formatting or build inconsistencies. Consider aligning the JDK version in the workflow with the toolchain version (21) specified in the Gradle build, or ensuring the workflow uses a JDK version that matches your project's actual requirements.

Suggested change
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"

Copilot uses AI. Check for mistakes.
- ".github/workflows/spotbugs-teamcode.yml"

concurrency:
group: spotbugs-${{ github.workflow }}-${{ github.ref }}
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concurrency group name 'spotbugs-${{ github.workflow }}-${{ github.ref }}' includes redundant information since github.workflow already contains the workflow name. This pattern is inconsistent with the other workflows which use 'format-' and 'ci-' prefixes. Consider using just '${{ github.workflow }}-${{ github.ref }}' for consistency across all workflows, or ensure all workflows follow the same naming pattern.

Suggested change
group: spotbugs-${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}

Copilot uses AI. Check for mistakes.
- ".github/workflows/**"

concurrency:
group: format-${{ github.workflow }}-${{ github.ref }}
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concurrency group name 'format-${{ github.workflow }}-${{ github.ref }}' includes redundant information since github.workflow already contains the workflow name. This pattern is inconsistent with the other workflows. Consider using just '${{ github.workflow }}-${{ github.ref }}' for consistency across all workflows, or ensure all workflows follow the same naming pattern.

Suggested change
group: format-${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}

Copilot uses AI. Check for mistakes.
skip-commit: true

- name: Fail if formatting changed (prints diff)
run: git --no-pager diff --exit-code
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step name 'Fail if formatting changed (prints diff)' doesn't provide a helpful error message when formatting issues are found. Consider adding an error message before the git diff command to explain what the developer needs to do, such as: 'echo "::error::Code formatting issues detected. Please run google-java-format locally and commit the changes." && git --no-pager diff && exit 1' when differences are found.

Suggested change
run: git --no-pager diff --exit-code
run: |
if ! git --no-pager diff --quiet; then
echo "::error::Code formatting issues detected. Please run google-java-format locally on 'TeamCode/**/*.java' and commit the changes."
git --no-pager diff
exit 1
fi

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines +55 to +59
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow sets up JDK 17, but TeamCode/build.gradle specifies Java 16 for sourceCompatibility/targetCompatibility and Java 21 for the toolchain. This version mismatch could lead to build inconsistencies between local development and CI. Consider aligning the JDK version in the workflow with the toolchain version (21) specified in the Gradle build, or ensuring the workflow uses a JDK version that matches your project's actual requirements.

Suggested change
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"

Copilot uses AI. Check for mistakes.
Comment on lines +81 to +86
echo "::error::No SpotBugs task found for :TeamCode. Make sure the SpotBugs Gradle plugin is applied/configured for TeamCode."
echo "Here are any spotbugs-related tasks Gradle sees:"
./gradlew -q :TeamCode:tasks --all | grep -i spotbugs || true
exit 1
fi

Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SpotBugs workflow will fail because the SpotBugs Gradle plugin is not applied in the TeamCode module or any build.gradle files. Before this workflow can function, you need to add the SpotBugs plugin to your Gradle configuration. Consider adding the plugin to TeamCode/build.gradle or build.common.gradle with proper configuration.

Suggested change
echo "::error::No SpotBugs task found for :TeamCode. Make sure the SpotBugs Gradle plugin is applied/configured for TeamCode."
echo "Here are any spotbugs-related tasks Gradle sees:"
./gradlew -q :TeamCode:tasks --all | grep -i spotbugs || true
exit 1
fi
echo "::warning::No SpotBugs task found for :TeamCode. SpotBugs will be skipped. Make sure the SpotBugs Gradle plugin is applied/configured for TeamCode if you expect these checks to run."
echo "Here are any spotbugs-related tasks Gradle sees:"
./gradlew -q :TeamCode:tasks --all | grep -i spotbugs || true
fi

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
- ".github/workflows/**"

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concurrency group name 'ci-${{ github.workflow }}-${{ github.ref }}' includes redundant information since github.workflow already contains the workflow name. This pattern is inconsistent with the other workflows. Consider using just '${{ github.workflow }}-${{ github.ref }}' for consistency across all workflows, or ensure all workflows follow the same naming pattern.

Suggested change
group: ci-${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +13
- ".github/workflows/**"
push:
branches:
- "Quali-1"
paths:
- "TeamCode/**/*.java"
- ".github/workflows/**"
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path filter '.github/workflows/**' will trigger this workflow when any workflow file changes, not just this specific workflow. This could cause unnecessary CI runs when unrelated workflows are modified. Consider using '.github/workflows/format-java.yml' to only trigger on changes to this specific workflow file, matching the pattern used in spotbugs-teamcode.yml.

Suggested change
- ".github/workflows/**"
push:
branches:
- "Quali-1"
paths:
- "TeamCode/**/*.java"
- ".github/workflows/**"
- ".github/workflows/format-java.yml"
push:
branches:
- "Quali-1"
paths:
- "TeamCode/**/*.java"
- ".github/workflows/format-java.yml"

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +13
- ".github/workflows/**"
push:
branches:
- "Quali-1"
paths:
- "TeamCode/**/*.java"
- ".github/workflows/**"
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path filter '.github/workflows/**' will trigger this workflow when any workflow file changes, not just this specific workflow. This could cause unnecessary CI runs when unrelated workflows are modified. Consider using '.github/workflows/format-java.yml' to only trigger on changes to this specific workflow file, matching the pattern used in spotbugs-teamcode.yml.

Suggested change
- ".github/workflows/**"
push:
branches:
- "Quali-1"
paths:
- "TeamCode/**/*.java"
- ".github/workflows/**"
- ".github/workflows/format-java.yml"
push:
branches:
- "Quali-1"
paths:
- "TeamCode/**/*.java"
- ".github/workflows/format-java.yml"

Copilot uses AI. Check for mistakes.
@arnavjosh arnavjosh changed the base branch from teleop to Quali-1 December 22, 2025 00:33
@arnavjosh arnavjosh closed this Dec 22, 2025
@tango8 tango8 deleted the github-workflows branch January 16, 2026 20:57
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.

6 participants