Skip to content

Add pre-commit GHA#1

Merged
kzawora-intel merged 16 commits into
mainfrom
private/kzawora/pre_commit_gha
Jul 11, 2025
Merged

Add pre-commit GHA#1
kzawora-intel merged 16 commits into
mainfrom
private/kzawora/pre_commit_gha

Conversation

@kzawora-intel
Copy link
Copy Markdown
Contributor

@kzawora-intel kzawora-intel commented Jun 25, 2025

This PR enables common pre-commit checks (ruff, yapf, mypy) and ensures that these checks pass.

Signed-off-by: Konrad Zawora <kzawora@habana.ai>
@kzawora-intel kzawora-intel force-pushed the private/kzawora/pre_commit_gha branch from 3eee452 to 58fb2c5 Compare June 25, 2025 16:42
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
@kzawora-intel kzawora-intel force-pushed the private/kzawora/pre_commit_gha branch from 5077053 to 09e5c90 Compare June 26, 2025 11:41
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
… a pyproject.toml config when path is not provided

Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
@kzawora-intel kzawora-intel merged commit 9882506 into main Jul 11, 2025
3 checks passed
@kzawora-intel kzawora-intel deleted the private/kzawora/pre_commit_gha branch July 28, 2025 10:15
adobrzyn added a commit that referenced this pull request Aug 7, 2025
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
adobrzyn added a commit that referenced this pull request Sep 5, 2025
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
skavulya pushed a commit to skavulya/vllm-gaudi that referenced this pull request Nov 11, 2025
* remove loop and optimize in get finished

* remove assert in non pd and port align_and_pad from main

* fix indentation issue
adobrzyn added a commit that referenced this pull request Mar 12, 2026
- #1: Add unit tests for _gather_mm_embeddings covering 1D contiguous
  and 2D padded batching paths
- #2: Use separate local variable (effective_total_tokens) instead of
  overriding the total_num_scheduled_tokens parameter in _get_model_mm_inputs

[- Reviewed by Awesome ChlOpus]
afierka-intel added a commit to afierka-intel/vllm-gaudi that referenced this pull request Mar 12, 2026
- Use local 'effective_total_tokens' instead of reassigning
  'total_num_scheduled_tokens' to avoid side effects (finding vllm-project#2)
- Guard 'req_start_idx' accumulation with 'if padded_seq_len is None'
  to avoid dead code in the padded path (finding vllm-project#3)
- Add unit tests for _gather_mm_embeddings covering both 2D padded
  and 1D non-padded paths (finding vllm-project#1)
adobrzyn added a commit that referenced this pull request May 21, 2026
…1473)

## Summary

Adds `environment: approved-workflow` to every job that consumes
`secrets.HF_TOKEN` across the three CI workflows. Together with the
existing approval gate in `pre-merge-trigger.yaml` (`environment:
pre-merge-approval`, added in #1471), this completes the two-layer
protection model:

```
PR opened
  -> pre-merge-trigger `gate` job: pauses for required reviewer (approval #1)
  -> on approval, pre-merge.yaml is dispatched
  -> downstream secret-using jobs resolve HF_TOKEN from the
     `approved-workflow` environment (no second per-job approval)
```

## Why

With `HF_TOKEN` previously at repo-secret scope, any matrix entry of any
e2e/test job had direct access the moment CI started. The recent
malicious fork PR exfiltrated it via an auto-discovered `run_*`
function. After this change, the token is only released from a GitHub
Environment that a maintainer-controlled deployment-branch rule
restricts to `main` / `releases/**`, and only after the upstream gate
has approved the dispatch.

We deliberately add the environment only on jobs that actually use the
secret (15 jobs). Helper jobs (`gatekeeper`, `discover_*`, `retrieve_*`,
`pre-commit`, `post-comment`, `cleanup_*`, `build_nixl_dockerfile`,
`check_dockerfile_changes`, `prepare-release-branch`,
`summarize_and_notify`, `setup_and_build`,
`store_last_stable_vllm_commit`) do not touch HF_TOKEN and are not
modified, to avoid pointless extra gate evaluations.

## Affected jobs (15)

- `pre-merge.yaml`: `hpu_unit_tests`, `hpu_pd_tests`, `hpu_perf_tests`,
`hpu_dp_tests`, `e2e`, `calibration_tests`
- `hourly-ci.yaml`: `run_unit_tests`, `e2e`, `run_data_parallel_test`,
`run_pd_disaggregate_test`
- `create-release-branch.yaml`: `run_unit_tests`, `e2e`,
`run_data_parallel_test`, `run_pd_disaggregate_test`,
`run_hpu_perf_tests`

## Diff

+15 lines, 0 deletions. Each touched job gets exactly one new line:
`environment: approved-workflow`, inserted immediately after `runs-on:`.

## Required repo configuration (before this PR can be merged safely)

1. Settings → Environments → create environment **`approved-workflow`**.
2. Add **`HF_TOKEN`** as an environment secret (the rotated value).
3. **No required reviewers** on this environment (the upstream
`pre-merge-approval` gate already enforces approval; adding reviewers
here would prompt once per job).
4. **Deployment branches and tags**: Selected branches → `main`,
`releases/**`. Prevents a fork PR from claiming the environment from a
non-trusted ref.
5. **Delete** `HF_TOKEN` from repository-level secrets so the
environment value is the only source.

## Testing

Validated end-to-end against `bmyrcha/vllm-gaudi` first using a benign
fork PR. With the two environments configured as above, the gate paused
as expected, jobs received the secret after approval without a second
prompt, and a deliberately mis-authored downstream PR could not reach
the secret.

Close-cross-ref: builds on #1471.

Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
mgawarkiewicz-intel pushed a commit that referenced this pull request May 25, 2026
#1491)

…#1473)

Adds `environment: approved-workflow` to every job that consumes
`secrets.HF_TOKEN` across the three CI workflows. Together with the
existing approval gate in `pre-merge-trigger.yaml` (`environment:
pre-merge-approval`, added in #1471), this completes the two-layer
protection model:

```
PR opened
  -> pre-merge-trigger `gate` job: pauses for required reviewer (approval #1)
  -> on approval, pre-merge.yaml is dispatched
  -> downstream secret-using jobs resolve HF_TOKEN from the
     `approved-workflow` environment (no second per-job approval)
```

With `HF_TOKEN` previously at repo-secret scope, any matrix entry of any
e2e/test job had direct access the moment CI started. The recent
malicious fork PR exfiltrated it via an auto-discovered `run_*`
function. After this change, the token is only released from a GitHub
Environment that a maintainer-controlled deployment-branch rule
restricts to `main` / `releases/**`, and only after the upstream gate
has approved the dispatch.

We deliberately add the environment only on jobs that actually use the
secret (15 jobs). Helper jobs (`gatekeeper`, `discover_*`, `retrieve_*`,
`pre-commit`, `post-comment`, `cleanup_*`, `build_nixl_dockerfile`,
`check_dockerfile_changes`, `prepare-release-branch`,
`summarize_and_notify`, `setup_and_build`,
`store_last_stable_vllm_commit`) do not touch HF_TOKEN and are not
modified, to avoid pointless extra gate evaluations.

- `pre-merge.yaml`: `hpu_unit_tests`, `hpu_pd_tests`, `hpu_perf_tests`,
`hpu_dp_tests`, `e2e`, `calibration_tests`
- `hourly-ci.yaml`: `run_unit_tests`, `e2e`, `run_data_parallel_test`,
`run_pd_disaggregate_test`
- `create-release-branch.yaml`: `run_unit_tests`, `e2e`,
`run_data_parallel_test`, `run_pd_disaggregate_test`,
`run_hpu_perf_tests`

+15 lines, 0 deletions. Each touched job gets exactly one new line:
`environment: approved-workflow`, inserted immediately after `runs-on:`.

1. Settings → Environments → create environment **`approved-workflow`**.
2. Add **`HF_TOKEN`** as an environment secret (the rotated value).
3. **No required reviewers** on this environment (the upstream
`pre-merge-approval` gate already enforces approval; adding reviewers
here would prompt once per job).
4. **Deployment branches and tags**: Selected branches → `main`,
`releases/**`. Prevents a fork PR from claiming the environment from a
non-trusted ref.
5. **Delete** `HF_TOKEN` from repository-level secrets so the
environment value is the only source.

Validated end-to-end against `bmyrcha/vllm-gaudi` first using a benign
fork PR. With the two environments configured as above, the gate paused
as expected, jobs received the secret after approval without a second
prompt, and a deliberately mis-authored downstream PR could not reach
the secret.

Close-cross-ref: builds on #1471.


(cherry picked from commit ca2d952)

Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
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.

1 participant