Skip to content

chore(ci): support branches from forks #1400

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 2 commits into from
May 12, 2025
Merged

Conversation

pront
Copy link
Member

@pront pront commented May 9, 2025

Summary

Follow up to #1398.

Extracted commits from https://github.com/vectordotdev/vrl/pull/1399/files#diff-4f5c849c205cf3224b7c13fdcfc7f684e272f85f2a7a8aae17d5ce4a0d9a7036.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

#!/bin/bash
set -euo pipefail

# Simulated PR info
VRL_GITHUB_REPO="Zettroke/vrl"
VRL_GITHUB_BRANCH="apply-function-closure-type-info"

# Create a temporary Cargo.toml
cat > Cargo.toml <<EOF
[dependencies]
vrl = { git = "https://github.com/vectordotdev/vrl.git", branch = "main", features = ["cli", "foo", sss] }
tokio = "1.0"
EOF

echo "🔧 Before:"
cat Cargo.toml

# Path to the Cargo.toml file
CARGO_TOML="Cargo.toml"

# Set new git repo and branch
VRL_GITHUB_REPO="some_fork"
VRL_GITHUB_BRANCH="some_branch"
NEW_GIT="https://github.com/${VRL_GITHUB_REPO}.git"
NEW_BRANCH="${VRL_GITHUB_BRANCH}"

# Extract existing features (if any)
EXISTING_FEATURES=$(sed -nE 's/.*vrl = \{[^}]*features = (\[[^]]*\]).*/\1/p' "$CARGO_TOML")

# Compose the new dependency line
if [[ -n "$EXISTING_FEATURES" ]]; then
  NEW_LINE="vrl = { git = \"$NEW_GIT\", branch = \"$NEW_BRANCH\", features = $EXISTING_FEATURES }"
else
  NEW_LINE="vrl = { git = \"$NEW_GIT\", branch = \"$NEW_BRANCH\" }"
fi

# Replace the old vrl line
sed -i.bak -E "s|vrl = \{[^}]*\}|$NEW_LINE|" "$CARGO_TOML"



echo -e "\n✅ After:"
cat Cargo.toml

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Checklist

  • Our CONTRIBUTING.md is a good starting place.
  • If this PR introduces changes to LICENSE-3rdparty.csv, please
    run dd-rust-license-tool write and commit the changes. More details here.
  • For new VRL functions, please also create a sibling PR in Vector to document the new function.

References

@pront pront requested a review from graphcareful May 9, 2025 20:19
@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label May 9, 2025
@pront pront enabled auto-merge May 9, 2025 20:19
@pront pront disabled auto-merge May 12, 2025 14:34
@pront pront merged commit e2dc3ec into main May 12, 2025
15 checks passed
@pront pront deleted the pront/forks-support-vector-check branch May 12, 2025 14:45
@pront
Copy link
Member Author

pront commented May 12, 2025

Merged so we can use it on open PRs and add it to required checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Changes in this PR do not need user-facing explanations in the release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant