Skip to content

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Aug 1, 2025

No description provided.

This comment was marked as off-topic.

gemini-code-assist[bot]

This comment was marked as outdated.

gemini-code-assist[bot]

This comment was marked as outdated.

@google-oss-bot

This comment was marked as off-topic.

@google-oss-bot

This comment was marked as off-topic.

@google-oss-bot

This comment was marked as off-topic.

@dconeybe
Copy link
Contributor Author

dconeybe commented Aug 1, 2025

/gemini summary

Copy link
Contributor

Summary of Changes

I've introduced shellcheck to our dataconnect bash scripts to improve their quality and maintainability. This PR adds a new shellcheck.sh script that lints all relevant bash files and applies various syntax improvements across existing scripts to adhere to shellcheck recommendations.

Highlights

  • New Shellcheck Script: A new script, firebase-dataconnect/scripts/shellcheck.sh, has been added to automate the linting process for all bash scripts within the emulator and scripts directories.
  • Bash Script Modernization: Several existing bash scripts have been updated to improve syntax and robustness, including changes to readonly variable declarations and consistent use of curly braces for variable expansions.
  • Improved Path Handling: The method for defining SCRIPT_DIR and PROJECT_ROOT_DIR in multiple scripts has been modified, separating the assignment from the readonly declaration for better clarity and adherence to linting rules.
  • Array Element Access Correction: Array element access in emulator.sh was corrected from "${gradle_emulator_binaries[@]}" to "${gradle_emulator_binaries[0]}" for more precise single-element retrieval.
Changelog
  • firebase-dataconnect/emulator/emulator.sh
    • Changed the declaration of SCRIPT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
    • Updated variable expansions from $arg to ${arg} and $emulator_binary to ${emulator_binary} for consistency.
    • Corrected array element access from "${gradle_emulator_binaries[@]}" to "${gradle_emulator_binaries[0]}" when expecting a single element.
    • Updated variable expansion from $wipe_and_restart_postgres_pod to ${wipe_and_restart_postgres_pod}.
  • firebase-dataconnect/emulator/start_postgres_pod.sh
    • Changed the declaration of SCRIPT_DIR from a single-line readonly assignment using readlink -f to a two-line assignment followed by readonly.
  • firebase-dataconnect/scripts/compile_kotlin.sh
    • Changed the declaration of PROJECT_ROOT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
  • firebase-dataconnect/scripts/emulator_run.sh
    • Changed the declaration of PROJECT_ROOT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
  • firebase-dataconnect/scripts/generateApiTxtFile.sh
    • Changed the declaration of PROJECT_ROOT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
  • firebase-dataconnect/scripts/generate_data_connect_sources.sh
    • Changed the declaration of PROJECT_ROOT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
  • firebase-dataconnect/scripts/run_all_tests.sh
    • Changed the declaration of PROJECT_ROOT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
  • firebase-dataconnect/scripts/run_integration_tests.sh
    • Changed the declaration of PROJECT_ROOT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
  • firebase-dataconnect/scripts/run_unit_tests.sh
    • Changed the declaration of PROJECT_ROOT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
  • firebase-dataconnect/scripts/shellcheck.sh
    • Added a new script to run shellcheck on all bash scripts within the emulator and scripts directories.
  • firebase-dataconnect/scripts/spotlessApply.sh
    • Changed the declaration of PROJECT_ROOT_DIR from a single-line readonly assignment to a two-line assignment followed by readonly.
Activity
  • github-actions[bot] posted a Javadoc Changes comment.
  • google-oss-bot posted a Size Report.
  • google-oss-bot posted a Coverage Report.
  • google-oss-bot posted a Startup Time Report.
  • gemini-code-assist[bot] suggested a more robust way to determine SCRIPT_DIR in firebase-dataconnect/emulator/emulator.sh.
  • gemini-code-assist[bot] raised a concern about glob patterns in firebase-dataconnect/scripts/shellcheck.sh, suggesting shopt -s nullglob for robustness.
  • dconeybe responded to the glob pattern concern, indicating that a failure in such cases is desired to highlight potentially incorrect patterns.
  • gemini-code-assist[bot] suggested using printf for more robust command debugging output in firebase-dataconnect/scripts/shellcheck.sh.
  • dconeybe requested a /gemini summary.

@dconeybe dconeybe changed the title dataconnect: shellcheck all bash shell scripts dataconnect: shellcheck (lint) bash shell scripts Aug 1, 2025
@dconeybe dconeybe merged commit c76768c into main Aug 1, 2025
354 of 358 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/shellcheck branch August 1, 2025 20:27
@firebase firebase locked and limited conversation to collaborators Sep 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants