Skip to content

ci: CI update for commitMsg#39254

Merged
sagar-qa007 merged 1 commit intoreleasefrom
ci/addingtextincommitmsg
Feb 13, 2025
Merged

ci: CI update for commitMsg#39254
sagar-qa007 merged 1 commit intoreleasefrom
ci/addingtextincommitmsg

Conversation

@sagar-qa007
Copy link
Contributor

@sagar-qa007 sagar-qa007 commented Feb 13, 2025

Description

Problem: The Schedule TBP data for both Release and Airgap workflows is currently identical in the database, making it difficult to distinguish between them.
Solution: Added the workflow name to the commitMsg column, ensuring a clear and accurate view of the data for each workflow.

Fixes # https://app.zenhub.com/workspaces/qa-63316faf86bb2e170ed2e46b/issues/gh/appsmithorg/appsmith/39253

Automation

/ok-to-test tags="@tag.SignIn"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13309520198
Commit: 87d33db
Cypress dashboard.
Tags: @tag.SignIn
Spec:


Thu, 13 Feb 2025 14:28:44 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a customizable input to specify the number of test iterations.
    • Updated test commands to conditionally target specific test files based on provided parameters.
  • Tests

    • Enhanced test reporting by appending workflow context to commit messages.
    • Improved workflow tracking with the addition of a variable reflecting the active workflow name.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2025

Walkthrough

This PR updates multiple CI workflows and Cypress scripts. The workflows now set a new environment variable (GITHUB_WORKFLOW) based on the current workflow name. Changes include a conditional in the Cypress test command to optionally use a specified test file and an input parameter (run_count) to repeat test runs. In addition, both dynamic and static Cypress scripts have been modified to append the workflow name to commit messages, and the utility script now exposes the workflow name through gitWorkflowName.

Changes

Files Change Summary
.github/workflows/ci-test-custom-script.yml, .github/workflows/ci-test-hosted.yml Added new environment variable GITHUB_WORKFLOW to capture the current workflow name for use in the Cypress test steps.
.github/workflows/ci-test-limited-with-count.yml, .github/workflows/ci-test-limited.yml Added GITHUB_WORKFLOW and, in the limited-with-count variant, a new input run_count with updated Cypress command logic (including --spec handling and test repetition).
app/client/cypress/scripts/cypress-split-dynamic.ts, app/client/cypress/scripts/cypress-split-static.ts Modified commit message construction by appending the workflow name into commitMsgWithWorkflow before database insertion.
app/client/cypress/scripts/util.ts Introduced a new property gitWorkflowName in the getVars method to read the GITHUB_WORKFLOW environment variable (non-required).

Sequence Diagram(s)

sequenceDiagram
    participant Trigger as Workflow Trigger
    participant CI as CI Workflow
    participant Cypress as Cypress Test Runner

    Trigger->>CI: Start Workflow
    CI->>CI: Set GITHUB_WORKFLOW from github.workflow
    CI->>CI: Check for inputs.spec & run_count
    alt inputs.spec provided
        CI->>Cypress: Execute Cypress with '--spec' flag
    else
        CI->>Cypress: Execute Cypress normally
    end
    alt run_count defined
        loop run_count times
            CI->>Cypress: Repeat test execution
        end
    end
    Cypress-->>CI: Return test results
Loading
sequenceDiagram
    participant App as App Client
    participant Util as Utility Module
    participant DB as Database

    App->>Util: getVars()
    Util-->>App: Returns vars including gitWorkflowName
    App->>DB: Insert commitMsg with appended workflow name
Loading

Possibly related PRs

Suggested labels

CI, ok-to-test

Suggested reviewers

  • sharat87
  • yatinappsmith
  • ApekshaBhosale

Poem

In our pipelines, a new light gleams,
GITHUB_WORKFLOW records our dreams.
Cypress tests now run with flair,
With spec checks and counts in the air.
Commit messages echo the workflow's name,
A code-song forged in our CI flame.
🚀 Happy coding and smooth deploys!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@sagar-qa007 sagar-qa007 added the ok-to-test Required label for CI label Feb 13, 2025
@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog CI labels Feb 13, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
.github/workflows/ci-test-hosted.yml (1)

251-251: Fix YAML formatting.

There are too many spaces before the colon in the GITHUB_WORKFLOW environment variable definition.

Apply this diff to fix the formatting:

-          GITHUB_WORKFLOW : ${{ github.workflow }}
+          GITHUB_WORKFLOW: ${{ github.workflow }}
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 251-251: too many spaces before colon

(colons)

.github/workflows/ci-test-limited.yml (1)

345-345: Fix YAML formatting.

Remove extra spaces before the colon to maintain consistent YAML formatting.

-          GITHUB_WORKFLOW : ${{ github.workflow }}
+          GITHUB_WORKFLOW: ${{ github.workflow }}
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 345-345: too many spaces before colon

(colons)

.github/workflows/ci-test-custom-script.yml (1)

374-374: Fix YAML formatting.

Remove extra spaces before the colon to maintain consistent YAML formatting.

-          GITHUB_WORKFLOW : ${{ github.workflow }}
+          GITHUB_WORKFLOW: ${{ github.workflow }}
.github/workflows/ci-test-limited-with-count.yml (1)

430-430: Fix YAML formatting.

Remove extra spaces before the colon to maintain consistent YAML formatting.

-            GITHUB_WORKFLOW : ${{ github.workflow }}
+            GITHUB_WORKFLOW: ${{ github.workflow }}
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 430-430: too many spaces before colon

(colons)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fdf7793 and 87d33db.

📒 Files selected for processing (7)
  • .github/workflows/ci-test-custom-script.yml (1 hunks)
  • .github/workflows/ci-test-hosted.yml (1 hunks)
  • .github/workflows/ci-test-limited-with-count.yml (1 hunks)
  • .github/workflows/ci-test-limited.yml (1 hunks)
  • app/client/cypress/scripts/cypress-split-dynamic.ts (2 hunks)
  • app/client/cypress/scripts/cypress-split-static.ts (2 hunks)
  • app/client/cypress/scripts/util.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test ...

app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
  • app/client/cypress/scripts/cypress-split-dynamic.ts
  • app/client/cypress/scripts/cypress-split-static.ts
  • app/client/cypress/scripts/util.ts
🪛 YAMLlint (1.35.1)
.github/workflows/ci-test-hosted.yml

[warning] 251-251: too many spaces before colon

(colons)

.github/workflows/ci-test-limited-with-count.yml

[warning] 430-430: too many spaces before colon

(colons)

.github/workflows/ci-test-limited.yml

[warning] 345-345: too many spaces before colon

(colons)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (4)
app/client/cypress/scripts/util.ts (1)

45-45: LGTM!

The addition of gitWorkflowName follows the existing pattern for environment variable retrieval and is correctly marked as non-required.

app/client/cypress/scripts/cypress-split-static.ts (1)

70-71: LGTM!

The addition of workflow name to commit message helps differentiate between Release and Airgap workflows in the database.

Also applies to: 83-83

app/client/cypress/scripts/cypress-split-dynamic.ts (1)

101-102: LGTM!

The changes mirror those in cypress-split-static.ts, maintaining consistency across both split strategies.

Also applies to: 114-114

.github/workflows/ci-test-limited-with-count.yml (1)

17-21: LGTM! Good addition of the run_count parameter.

The new parameter allows for flexible test execution by specifying the number of test runs, with a sensible default of 1.

Copy link
Collaborator

@btsgh btsgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For identifying airgapped specific workflows.

@sagar-qa007 sagar-qa007 merged commit ebe465b into release Feb 13, 2025
47 checks passed
@sagar-qa007 sagar-qa007 deleted the ci/addingtextincommitmsg branch February 13, 2025 14:29
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
## Description

**Problem**: The Schedule TBP data for both Release and Airgap workflows
is currently identical in the database, making it difficult to
distinguish between them.
**Solution**: Added the workflow name to the commitMsg column, ensuring
a clear and accurate view of the data for each workflow.


Fixes #
https://app.zenhub.com/workspaces/qa-63316faf86bb2e170ed2e46b/issues/gh/appsmithorg/appsmith/39253


## Automation

/ok-to-test tags="@tag.SignIn"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13309520198>
> Commit: 87d33db
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13309520198&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.SignIn`
> Spec:
> <hr>Thu, 13 Feb 2025 14:28:44 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced a customizable input to specify the number of test
iterations.
- Updated test commands to conditionally target specific test files
based on provided parameters.

- **Tests**
- Enhanced test reporting by appending workflow context to commit
messages.
- Improved workflow tracking with the addition of a variable reflecting
the active workflow name.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI ok-to-test Required label for 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.

2 participants