Skip to content

Hydrate repo from remote #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 4, 2025
Merged

Hydrate repo from remote #50

merged 4 commits into from
Jun 4, 2025

Conversation

salvador-barboza
Copy link
Collaborator

No description provided.

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

@Copilot 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
Preview

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.

@@ -11,3 +17,5 @@ sudo chown -R node /var/log/
supervisord
supervisorctl reread
supervisorctl update

npm i
Copy link
Preview

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.

@@ -3,6 +3,12 @@
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
"$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.

2 participants