Skip to content

Commit

Permalink
Merge branch 'master' into nico/cookbook/feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
NiWaRe authored Oct 15, 2024
2 parents b57811c + 5e44816 commit f4f4798
Show file tree
Hide file tree
Showing 1,197 changed files with 31,229 additions and 13,248 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
weave/frontend/** linguist-generated=true
weave_query/weave_query/frontend/** linguist-generated=true
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
* @wandb/weave-team
weave-js/src/common @wandb/fe-infra-reviewers
weave-js/src/components @wandb/fe-infra-reviewers @wandb/weave-team
weave-js/src/assets @wandb/fe-infra-reviewers @wandb/weave-team
88 changes: 88 additions & 0 deletions .github/workflows/check-which-tests-to-run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Check which tests to run

on:
workflow_call:
outputs:
weave_query_tests:
value: ${{ jobs.check.outputs.weave_query_tests }}
weave_js_tests:
value: ${{ jobs.check.outputs.weave_js_tests }}
trace_server_tests:
value: ${{ jobs.check.outputs.trace_server_tests }}

env:
WEAVE_QUERY_PATHS: 'weave_query/'
WEAVE_JS_PATHS: 'weave-js/'
TRACE_SERVER_PATHS: 'weave/trace_server/'
# Everything else is implicitly trace SDK

jobs:
check:
runs-on: ubuntu-latest
outputs:
weave_query_tests: ${{ steps.weave_query.outputs.run_tests }}
weave_js_tests: ${{ steps.weave_js.outputs.run_tests }}
trace_server_tests: ${{ steps.trace_server.outputs.run_tests }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.head_ref }}
- name: Get changed files
run: |
# Fetch all branches
git fetch --all
# Determine the base branch and current commit
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# For pull requests
BASE_BRANCH="${{ github.base_ref }}"
CURRENT_COMMIT="${{ github.event.pull_request.head.sha }}"
else
# For pushes
BASE_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
CURRENT_COMMIT="${{ github.sha }}"
fi
echo "Base branch is $BASE_BRANCH"
# Find the common ancestor
MERGE_BASE=$(git merge-base origin/$BASE_BRANCH $CURRENT_COMMIT)
# Get changed files
changed_files=$(git diff --name-only $MERGE_BASE $CURRENT_COMMIT)
echo "Changed files:"
echo "$changed_files"
echo "changed_files<<EOF" >> $GITHUB_ENV
echo "$changed_files" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- id: weave_query
name: Weave Query Checks
run: |
for path in ${{ env.WEAVE_QUERY_PATHS }}; do
if echo "$changed_files" | grep -q "$path"; then
echo "run_tests=true" >> $GITHUB_OUTPUT
exit 0
fi
done
echo "run_tests=false" >> $GITHUB_OUTPUT
- id: weave_js
name: Weave JS Checks
run: |
for path in ${{ env.WEAVE_JS_PATHS }}; do
if echo "$changed_files" | grep -q "$path"; then
echo "run_tests=true" >> $GITHUB_OUTPUT
exit 0
fi
done
echo "run_tests=false" >> $GITHUB_OUTPUT
- id: trace_server
name: Weave Trace Server Checks
run: |
for path in ${{ env.TRACE_SERVER_PATHS }}; do
if echo "$changed_files" | grep -q "$path"; then
echo "run_tests=true" >> $GITHUB_OUTPUT
exit 0
fi
done
echo "run_tests=false" >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
# branch should not be protected
branch: "cla"
# cannot use teams due to: https://github.com/contributor-assistant/github-action/issues/100
allowlist: actions-user, altay, bdytx5, dannygoldstein, davidwallacejackson, jamie-rasmussen, jlzhao27, jo-fang, jwlee64, laxels, morganmcg1, nickpenaranda, scottire, shawnlewis, staceysv, tssweeney, vanpelt, vwrj, wandbmachine
allowlist: actions-user, altay, andrewtruong, bdytx5, dannygoldstein, davidwallacejackson, jamie-rasmussen, jlzhao27, jo-fang, jwlee64, laxels, morganmcg1, nickpenaranda, scottire, shawnlewis, staceysv, tssweeney, vanpelt, vwrj, wandbmachine, [email protected]
7 changes: 5 additions & 2 deletions .github/workflows/notify-wandb-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ name: Notify wandb/core
on:
push:
branches:
- "**"
- '**'
workflow_dispatch:

jobs:
check-which-tests-to-run:
uses: ./.github/workflows/check-which-tests-to-run.yaml
notify-wandb-core:
needs: check-which-tests-to-run
runs-on: ubuntu-latest
steps:
- name: Repository dispatch
Expand All @@ -19,4 +22,4 @@ jobs:
token: ${{ secrets.WANDB_CORE_ACCESS_TOKEN }}
repository: wandb/core
event-type: weave-package-updated
client-payload: '{"ref_name": "${{ github.ref_name }}", "sha": "${{ github.sha }}"}'
client-payload: '{"ref_name": "${{ github.ref_name }}", "sha": "${{ github.sha }}", "run_weave_js_tests": ${{ needs.check-which-tests-to-run.outputs.weave_js_tests }}, "run_weave_query_tests": ${{ needs.check-which-tests-to-run.outputs.weave_query_tests }}, "run_trace_server_tests": ${{ needs.check-which-tests-to-run.outputs.trace_server_tests }}}'
26 changes: 14 additions & 12 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Validate PR
name: Check PR

on:
workflow_dispatch:
pull_request_target:
types: [opened, edited, synchronize]

Expand All @@ -10,26 +11,27 @@ jobs:
runs-on: ubuntu-latest
steps:
# https://github.com/amannn/action-semantic-pull-request/releases
- uses: amannn/action-semantic-pull-request@v4.2.0
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.PR_TITLE_GITHUB_TOKEN }}
with:
# Allowed types: https://www.notion.so/wandbai/Pull-Requests-17966b997841407b95b7c36414ae0634
# Allowed types: See CONTRIBUTING.md
types: |
chore
docs
feat
fix
docs
style
refactor
perf
test
analytics
build
ci
chore
refactor
revert
style
security
release
test
scopes: |
ui
weave
weave_query
wip: false
requireScope: true
validateSingleCommit: false
validateSingleCommitMatchesPrTitle: false
20 changes: 9 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: "18.x"
- run: |
pip install build twine
./build_dist.py
if [[ -n "$(git status weave/frontend/sha1.txt --porcelain)" ]]
then
echo "::error cannot publish release, commited SHA does not match build SHA"
exit 1
fi
- name: Install uv
run: |
pip install uv
- name: Build dist
run: |
uv build
- name: Make docs
run: |
make docs
- name: upload test distribution
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ inputs.is_test }}
Expand Down
Loading

0 comments on commit f4f4798

Please sign in to comment.