Skip to content

Commit

Permalink
Fix zizmor for perf.
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyzdanovich committed Dec 24, 2024
1 parent e0cfc16 commit de1a8cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/prover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ on:

jobs:
eval_perf:
permissions: write-all
permissions:
# Needed to install the toolchain.
contents: write
# Needed to post the performance report comments.
issues: write
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -50,12 +54,9 @@ jobs:
cargo run --profile prover-ci -- \
--post-to-gh \
--github-token "${{ secrets.GITHUB_TOKEN }}" \
--repo-owner "${{ github.repository_owner }}" \
--repo-name "${{ github.event.repository.name }}" \
--pr-number "${{ github.event.pull_request.number }}" \
--branch-name "${{ github.head_ref || github.ref_name }}" \
--commit-hash "${{ github.sha }}" \
--author "${{ github.event.pull_request.user.login || github.actor }}"
working-directory: provers/perf
env:
RUSTFLAGS: "-C target-cpu=native -C link-arg=-fuse-ld=lld"
Expand Down
20 changes: 2 additions & 18 deletions provers/perf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ struct EvalArgs {
#[arg(long, default_value = "")]
pub github_token: String,

/// The GitHub repository owner.
#[arg(long, default_value = "")]
pub repo_owner: String,

/// The GitHub repository name.
#[arg(long, default_value = "")]
pub repo_name: String,

/// The GitHub PR number.
#[arg(long, default_value = "")]
pub pr_number: String,
Expand All @@ -64,10 +56,6 @@ struct EvalArgs {
/// The commit hash.
#[arg(long, default_value = "local_commit")]
pub commit_hash: String,

/// The author of the commit.
#[arg(long, default_value = "local")]
pub author: String,
}

/// Basic data about the performance of a certain [`ZkVmProver`].
Expand Down Expand Up @@ -181,7 +169,6 @@ fn format_header(args: &EvalArgs) -> String {
if args.post_to_gh {
detail_text.push_str(&format!("*Branch*: {}\n", &args.branch_name));
detail_text.push_str(&format!("*Commit*: {}\n", &args.commit_hash[..8]));
detail_text.push_str(&format!("*Author*: {}\n", &args.author));
} else {
detail_text.push_str("*Local execution*\n");
}
Expand Down Expand Up @@ -217,13 +204,10 @@ async fn post_to_github_pr(
message: &str,
) -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let base_url = format!(
"https://api.github.com/repos/{}/{}",
&args.repo_owner, &args.repo_name
);

// Get all comments on the PR
let comments_url = format!("{}/issues/{}/comments", base_url, &args.pr_number);
const BASE_URL: &str = "https://api.github.com/repos/alpenlabs/strata";
let comments_url = format!("{}/issues/{}/comments", BASE_URL, &args.pr_number);
let comments_response = client
.get(&comments_url)
.header("Authorization", format!("token {}", &args.github_token))
Expand Down

0 comments on commit de1a8cf

Please sign in to comment.