Skip to content

Commit e1a4a54

Browse files
committed
Fix PR CI plugin formatting and release resolve
Signed-off-by: lucarlig <luca.carlig@ibm.com>
1 parent dae3cd3 commit e1a4a54

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/release-rust-python-package.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
REPOSITORY_INPUT: ${{ inputs.repository }}
6464
run: |
6565
set -euo pipefail
66-
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" || "${GITHUB_EVENT_NAME}" == "workflow_call" ]]; then
66+
if [[ -n "${TAG_INPUT}" ]]; then
6767
tag="${TAG_INPUT}"
6868
repository="${REPOSITORY_INPUT}"
6969
git fetch --force origin "refs/tags/${tag}:refs/tags/${tag}"
@@ -78,7 +78,7 @@ jobs:
7878
release_info="$(python3 tools/plugin_catalog.py release-info . "${tag}")"
7979
plugin="$(printf '%s' "${release_info}" | python3 -c 'import json, sys; print(json.load(sys.stdin)["slug"])')"
8080
plugin_path="$(printf '%s' "${release_info}" | python3 -c 'import json, sys; print(json.load(sys.stdin)["path"])')"
81-
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" || "${GITHUB_EVENT_NAME}" == "workflow_call" ]]; then
81+
if [[ -n "${TAG_INPUT}" ]]; then
8282
wheel_matrix="$(python3 -c 'import json; print(json.dumps([{"runner":"ubuntu-latest","platform":"linux-x86_64"},{"runner":"ubuntu-24.04-arm","platform":"linux-aarch64"},{"runner":"ubuntu-24.04-s390x","platform":"linux-s390x"},{"runner":"ubuntu-24.04-ppc64le","platform":"linux-ppc64le"},{"runner":"macos-latest","platform":"macos-arm64"},{"runner":"windows-latest","platform":"windows-x86_64"}]))')"
8383
else
8484
wheel_matrix="$(printf '%s' "${release_info}" | python3 -c 'import json, sys; print(json.dumps(json.load(sys.stdin)["release_wheel_matrix"]))')"

plugins/rust/python-package/encoded_exfil_detection/src/bin/stub_gen.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ fn curate_top_level_stub() {
1313
}
1414

1515
fn curate_extension_stub() {
16-
let stub_path = Path::new("cpex_encoded_exfil_detection/encoded_exfil_detection_rust/__init__.pyi");
16+
let stub_path =
17+
Path::new("cpex_encoded_exfil_detection/encoded_exfil_detection_rust/__init__.pyi");
1718
let content = fs::read_to_string(stub_path).expect("Failed to read generated stub file");
1819
let content = content.trim_end().to_string() + "\n";
1920
fs::write(stub_path, content).expect("Failed to write curated extension stub file");

plugins/rust/python-package/url_reputation/src/bin/stub_gen.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ fn main() {
1313
let top_level = "# This file is automatically generated by pyo3_stub_gen\n# ruff: noqa: E501, F401, F403, F405\n\nfrom .url_reputation import URLReputationConfig, URLReputationPlugin\nfrom .url_reputation_rust import URLReputationEngine\n\n__all__ = [\n \"URLReputationConfig\",\n \"URLReputationEngine\",\n \"URLReputationPlugin\",\n]\n";
1414
let rust_stub = "# This file is automatically generated by pyo3_stub_gen\n# ruff: noqa: E501, F401, F403, F405\n\nimport typing\n\n__all__ = [\n \"URLReputationEngine\",\n \"URLReputationPluginCore\",\n \"URLReputationResult\",\n]\n\n\n@typing.final\nclass URLReputationResult:\n continue_processing: bool\n violation: typing.Any\n\n\n@typing.final\nclass URLReputationEngine:\n def __new__(cls, config: dict) -> URLReputationEngine: ...\n def validate_url(self, url: str) -> URLReputationResult: ...\n\n\n@typing.final\nclass URLReputationPluginCore:\n def __new__(cls, config: dict) -> URLReputationPluginCore: ...\n def resource_pre_fetch(self, payload: typing.Any, context: typing.Any) -> typing.Any: ...\n";
1515
write_stub("cpex_url_reputation/__init__.pyi", top_level);
16-
write_stub("cpex_url_reputation/url_reputation_rust/__init__.pyi", rust_stub);
16+
write_stub(
17+
"cpex_url_reputation/url_reputation_rust/__init__.pyi",
18+
rust_stub,
19+
);
1720
println!("✓ Generated stub files successfully");
1821
}

0 commit comments

Comments
 (0)