Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Remove inert ADS compliance check #33603

Merged
merged 11 commits into from
May 21, 2024
Merged

ci: Remove inert ADS compliance check #33603

merged 11 commits into from
May 21, 2024

Conversation

sharat87
Copy link
Member

@sharat87 sharat87 commented May 20, 2024

The ADS compliance check relies on the condition github.pull_request.base.ref == 'true', but this variable just doesn't exist. There's no pull_request under the github context, so this ADS compliance check never worked.

If we want this check, we can add it later as part of the client-build.compliance.js script. Here's a PoC for the record, based on the intention I interpreted:

function doADSCheck({core, github, context, affectedFiles}) {
  const filesForADSCheck = affectedFiles.filter(f => (f.status === "added" || f.status === "modified") && f.filename.startsWith("app/client/src/"));

  const violatedFiles = new Set();
  for (const f of filesForADSCheck) {
    const content = fs.readFileSync(f.filename, "utf8");
    if (content.match(/(color|Color).*#|border.*#|(color|Color).*"/)) {
      violatedFiles.add(f.filename);
    }
  }

  if (violatedFiles.size === 0) {
    return;
  }

  const body = [
    "馃敶 Below files are not compliant with ADS. Please fix and re-trigger ok-to-test",
    ...Array.from(violatedFiles).sort().map(f => "1. " + f),
  ].join("\n");

  github.rest.issues.createComment({
    owner: context.repo.owner,
    repo: context.repo.repo,
    issue_number: prNumber,
    body,
  });
}

/test sanity

@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test labels May 20, 2024
Copy link

馃敶 There's new test files in JS, please port to TS and re-trigger Cypress tests:

  1. app/client/cypress/e2e/violation.js

Copy link

馃敶 There's new test files in JS, please port to TS and re-trigger Cypress tests:

  1. app/client/cypress/e2e/violation.js

Copy link

馃敶 There's new test files in JS, please port to TS and re-trigger Cypress tests:

  1. app/client/cypress/e2e/violation.js

@sharat87 sharat87 changed the title test: dummy ci: Remove inert ADS compliance check May 21, 2024
@github-actions github-actions bot added CI and removed Test labels May 21, 2024
@sharat87 sharat87 marked this pull request as ready for review May 21, 2024 04:50
Copy link
Contributor

coderabbitai bot commented May 21, 2024

Walkthrough

Walkthrough

The recent updates to the GitHub Actions workflow for client builds involve simplifying the process by removing specific compliance checks and conditional steps. This streamlines the workflow by eliminating the enforcement of certain rules on files within the client/src directory and the creation of comments on pull requests regarding test file compliance. Additionally, the workflow no longer includes a step that conditionally exits with an error based on specific criteria.

Changes

File Change Summary
.github/workflows/client-build.yml Removed sections related to checking file compliance in client/src, comment creation for PRs, and conditional error exit steps.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 2459607 and 58bdee1.
Files selected for processing (1)
  • .github/workflows/client-build.yml (2 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/client-build.yml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mohanarpit
Copy link
Member

@sharat87 I've approved these changes. But wasn't this code working at some point? I'm sure I've seen failure messages in the past when we did violate ADS compliance. Or maybe I dreamt it 馃槢

@sharat87
Copy link
Member Author

sharat87 commented May 21, 2024

@mohanarpit, I'm actually surprised myself cause I also recall seeing failure messages from this. But it looks like the original commit that added this check also had github.pull_request. That leads me to wonder if GitHub themselves have changed the API here? 馃 馃し

@sharat87 sharat87 merged commit 35774bb into release May 21, 2024
18 checks passed
@sharat87 sharat87 deleted the sharat87-patch-3 branch May 21, 2024 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants