Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

Commit 220ceb1

Browse files
authored
chore: add GitHub Actions for auto upstream sync and update SEALData subsample logic (apache#289)
This PR includes the following changes: 1. chore(workflow): - Add .github/pull.yml to configure pull request rules for automatic syncing with the upstream apache/main branch, including assignees and reviewers. - Add .github/workflows/sync.yml to enable scheduled (every 3 hours) and manual synchronization of the fork with the upstream repository using the Fork-Sync-With-Upstream-action. Includes error handling for workflow suspension. 2. chore(seal): - Update the SEALData.__call__ method in hugegraph_ml/models/seal.py to remove the assignment of subsample_ratio for both "train" and other split types, replacing it with pass statements. - Update the file path string formatting for saving subsampled data. These changes help automate repository maintenance and clarify the SEALData subsampling logic. No functional changes to model behavior are introduced.
1 parent 8601058 commit 220ceb1

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

.github/pull.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: "1"
2+
rules:
3+
- base: main
4+
upstream: apache/main
5+
mergeMethod: rebase
6+
assignees:
7+
- imbajin
8+
reviewers:
9+
- imbajin
10+
conflictReviewers:
11+
- imbajin

.github/workflows/sync.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Upstream Sync
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
schedule:
8+
- cron: "0 */3 * * *" # every 3 hours
9+
workflow_dispatch:
10+
11+
jobs:
12+
sync_latest_from_upstream:
13+
name: Sync latest commits from upstream repo
14+
runs-on: ubuntu-latest
15+
if: ${{ github.event.repository.fork }}
16+
17+
steps:
18+
# Step 1: run a standard checkout action
19+
- name: Checkout target repo
20+
uses: actions/checkout@v4
21+
22+
# Step 2: run the sync action
23+
- name: Sync upstream changes
24+
id: sync
25+
uses: aormsby/[email protected]
26+
with:
27+
upstream_sync_repo: apache/incubator-hugegraph-ai
28+
upstream_sync_branch: main
29+
target_sync_branch: main
30+
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
31+
32+
# Set test_mode true to run tests instead of the true action!!
33+
test_mode: false
34+
35+
- name: Sync check
36+
if: failure()
37+
run: |
38+
echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork. Please refer to the detailed tutorial for instructions: https://github.com/Yidadaa/ChatGPT-Next-Web#enable-automatic-updates"
39+
exit 1

hugegraph-ml/src/hugegraph_ml/models/seal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from scipy.sparse.csgraph import shortest_path
5050
from tqdm import tqdm
5151

52+
5253
class GCN(nn.Module):
5354
"""
5455
GCN Model
@@ -704,7 +705,7 @@ def __call__(self, split_type):
704705

705706
path = osp.join(
706707
self.save_dir or "",
707-
"f{self.prefix}_{split_type}_{self.hop}-hop_{subsample_ratio}-subsample.bin"
708+
f"{self.prefix}_{split_type}_{self.hop}-hop_{subsample_ratio}-subsample.bin",
708709
)
709710

710711
if osp.exists(path):

0 commit comments

Comments
 (0)