Skip to content

Conversation

@salvador-barboza
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 28, 2025 16:30
Copy link
Contributor

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

Adds support for hydrating the repository from a remote snapshot URL and ensures project dependencies are installed in the devcontainer.

  • Introduce a condition to run hydrate.sh in the background when SNAPSHOT_SAS_URL is provided.
  • Log hydration output to hydration.log in the workspace.
  • Append npm i at the end of the startup script to install dependencies.

# Check if SNAPSHOT_SAS_URL was passed, if so run hydrate.sh in background
if [ -n "$SNAPSHOT_SAS_URL" ]; then
WORKSPACE_DIR="/workspaces/spark-template"
SAS_URI="$SNAPSHOT_SAS_URL" /usr/local/bin/hydrate.sh $WORKSPACE_DIR > $WORKSPACE_DIR/hydration.log 2>&1 &
Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

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

Quote the redirection path to handle potential spaces in the workspace directory, e.g., > "$WORKSPACE_DIR/hydration.log".

Suggested change
SAS_URI="$SNAPSHOT_SAS_URL" /usr/local/bin/hydrate.sh $WORKSPACE_DIR > $WORKSPACE_DIR/hydration.log 2>&1 &
SAS_URI="$SNAPSHOT_SAS_URL" /usr/local/bin/hydrate.sh $WORKSPACE_DIR > "$WORKSPACE_DIR/hydration.log" 2>&1 &

Copilot uses AI. Check for mistakes.
supervisorctl reread
supervisorctl update

npm i
Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

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

Consider switching to npm ci for deterministic installs and ensure it runs in the project root, e.g., cd $WORKSPACE_DIR && npm ci.

Suggested change
npm i
WORKSPACE_DIR="/workspaces/spark-template"
cd $WORKSPACE_DIR && npm ci

Copilot uses AI. Check for mistakes.
"$SCRIPT_DIR/refreshTools.sh"

# Check if SNAPSHOT_SAS_URL was passed, if so run hydrate.sh in background
if [ -n "$SNAPSHOT_SAS_URL" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will need some indicator to know when this is finished

@salvador-barboza salvador-barboza merged commit 930371b into main Jun 4, 2025
@salvador-barboza salvador-barboza deleted the chava/hydrate-repo branch June 4, 2025 15:21
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.

3 participants