Skip to content

Conversation

@jakubsob
Copy link
Owner

@jakubsob jakubsob commented Jul 16, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved the normalization process for feature files to ensure step keywords are only replaced at the start of lines, preserving indentation and preventing unintended replacements within step descriptions.
  • Tests

    • Added a test to confirm that only leading step keywords are replaced, and not keywords within step descriptions.
    • Updated test snapshots to reflect changes in error reporting locations.
  • Chores

    • Incremented the package version to 2.1.1 and updated the changelog.
    • Updated mutation testing workflow to use new function calls.

@coderabbitai
Copy link

coderabbitai bot commented Jul 16, 2025

## Walkthrough

The patch increments the package version to 2.1.1, documents a bug fix in the changelog, and updates the `map_keywords` function in `normalize_feature.R` to only replace step keywords at the start of lines, preserving indentation. Related tests and test snapshots are updated to verify this behavior and reflect source line changes. The mutation testing workflow script was also updated to use a new function call.

## Changes

| File(s)                                         | Change Summary                                                                                       |
|------------------------------------------------|----------------------------------------------------------------------------------------------------|
| DESCRIPTION                                     | Incremented package version from 2.1.0 to 2.1.1 and added "muttest" to Suggests                     |
| NEWS.md                                         | Added changelog entry for version 2.1.1, documenting a bug fix in feature file normalization       |
| R/normalize_feature.R                           | Modified `map_keywords` to anchor keyword replacements to line starts, preserving indentation      |
| tests/testthat/test-normalize_feature.R         | Added test to ensure only leading step keywords are replaced, not those in step descriptions       |
| tests/testthat/_snaps/local/examples.md          | Updated error backtrace line numbers in test snapshot output                                       |
| .github/workflows/test-mutation.yml              | Replaced `muttest::test_plan()` with `muttest::plan()` and `muttest::test()` with `muttest::muttest()` in mutation testing workflow |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Test as Test Suite
    participant Normalize as normalize_feature()
    participant Map as map_keywords()

    Test->>Normalize: Call normalize_feature() with feature lines
    Normalize->>Map: map_keywords(line)
    Map-->>Normalize: Replace step keywords only at start of lines
    Normalize-->>Test: Return normalized feature lines

Poem

A patch hops in, so neat and small,
Anchored keywords at line's first call.
Indents preserved, no more surprise,
Only starts get a "Step" disguise.
Tests now pass with bunny cheer—
Version 2.1.1 is here!
🥕


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 2c8aae37fd53bb09e478d5f4dccf0641b29be69f and 11af9cac57ae028aee16cb5a703ff6d0ee2479a4.

</details>

<details>
<summary>📒 Files selected for processing (6)</summary>

* `.github/workflows/test-mutation.yml` (2 hunks)
* `DESCRIPTION` (2 hunks)
* `NEWS.md` (1 hunks)
* `R/normalize_feature.R` (1 hunks)
* `tests/testthat/_snaps/local/examples.md` (2 hunks)
* `tests/testthat/test-normalize_feature.R` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (6)</summary>

* tests/testthat/test-normalize_feature.R
* NEWS.md
* DESCRIPTION
* tests/testthat/_snaps/local/examples.md
* .github/workflows/test-mutation.yml
* R/normalize_feature.R

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)</summary>

* GitHub Check: ubuntu-latest (release)
* GitHub Check: ubuntu-latest (devel)
* GitHub Check: ubuntu-latest (oldrel-1)
* GitHub Check: test-coverage
* GitHub Check: test-coverage
* GitHub Check: test-coverage
* GitHub Check: ubuntu-latest (devel)
* GitHub Check: test-coverage
* GitHub Check: generate-badge
* GitHub Check: ubuntu-latest (release)
* GitHub Check: ubuntu-latest (oldrel-1)

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS6BeDcABe5AkAmDQEY3BgHLZmAyl1cAVgMAVUR/SCE0AGtsAURBI31jcCgyenwAMxwCYjJlGnomVnYuXn5hUXEpGXkmJSpVdS0dZJMoOFRUTBzCUnIqQoUSjE5IKgB3SE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33mOgO291S63UbRgxADJ4DvTbJQ+N00cR9OQN2o58J+otsRsgZ4TMyBUxFs+gWosiaYHoBjV5N8tYlIlRu2uJAm2LoAfwhAhkd0gYJWGTQMB8TDiqGFMl00mAYApNldsrraF62/NHGMYHhU1t1C7PtA65SxypLeza965xQUQvQfFPoYPEQPUegKn45i6zkdQ0gtAkFavcoa3V+JfIGoHOCY1oUMhmsiha0hsVrUrjtRuVKBgNCFzxHEdKCNoiovwBMZ1HrPS5g+hoWQzALCBtclVUNlK6o3gSXxh8yTTP5McR3Uc+n0JTH3Zzd61I0b0KZWmyAaTEWdkrf/T5yLexDH5O5/+nnoxjImVMz5soTaMnyY9fESWFEpZjLzLA8F/nknZMwZapnHGXMcflErnt3lUpWl6eMlzGvNaowukgIHp6ZLJvCacCbwQFcAm9Aoo5ECpm+CKMUWIZlZaEY7cC/88s1jwB5+MfC0YRaGICqrrXrY+jq/GJrIcMxHdqxwGrZ33liozBK6CyrZaqrzDe9N8I9MGamOhQuDA5SlNoKiBkolxSvRKVQUsH45gSlIFNFymq3KoM4+g8T/l5pSbwTJuV5joqKatUkNMGZlX8mkwQyc8n8dWPkOj7BABuXD0WFGxZ7ZBxa33fPTHY9NV78I9t0FsRubY7QSEZGyGgPAfR7NDGKFNLgkxgTXgakseoygmjrFaFsAwou5fqHyvAJG+UIZallrQDxuZn7JB16kSAoKU0ADYSAAE5Ai0Ad7pB3AAOZ3Dv7dQt0lChgmQHd6VUNyJQukvdoFcBHlQ9vNiGFFwIUFAhMi6ScCQbkrh0+uGD87hguk0AO9oF7h3gQfckA94Xh3ThM+l5IF77kvI2i26cAwaPaASAwsyLQQIULw/O5ILpUFXu+/p9oFnTI3IPeuAEE4Z3fgHfO+yK3iAILXBoEyAXxEgR7dZ6cNH3rrgHcMAEIENAoLuRQsyCH2g3JetOBH87tA+lre65YMwfXhvEDG5IJDF8OgfKdIRPIAA=== -->

<!-- internal state end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=jakubsob/cucumber&utm_content=15):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `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 explain this code block.`
  -	`@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 explain its main purpose.`
  - `@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.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

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](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@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.

### CodeRabbit Configuration 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@jakubsob jakubsob changed the title v2.1.1 🚀 v2.1.1 Jul 16, 2025
Copy link

@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 (1)
tests/testthat/test-normalize_feature.R (1)

78-104: Great test coverage for the bug fix, but fix the typo in the test name.

The test logic correctly validates that keywords are only replaced at the start of lines, not within step descriptions. However, there's a typo in the test name.

Apply this diff to fix the typo:

-  it("shouldn replace only keywords, not words in step descriptions", {
+  it("should replace only keywords, not words in step descriptions", {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e2e36d and 7add6e9.

📒 Files selected for processing (5)
  • DESCRIPTION (1 hunks)
  • NEWS.md (1 hunks)
  • R/normalize_feature.R (1 hunks)
  • tests/testthat/_snaps/local/examples.md (2 hunks)
  • tests/testthat/test-normalize_feature.R (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: test-coverage
  • GitHub Check: ubuntu-latest (release)
  • GitHub Check: ubuntu-latest (oldrel-1)
  • GitHub Check: ubuntu-latest (devel)
  • GitHub Check: test-coverage
  • GitHub Check: ubuntu-latest (devel)
  • GitHub Check: ubuntu-latest (release)
  • GitHub Check: ubuntu-latest (oldrel-1)
  • GitHub Check: test-coverage
  • GitHub Check: test-coverage
🔇 Additional comments (4)
DESCRIPTION (1)

4-4: LGTM! Version increment is appropriate for a patch release.

The version bump from 2.1.0 to 2.1.1 correctly follows semantic versioning for a patch release containing bug fixes.

tests/testthat/_snaps/local/examples.md (1)

330-330: Snapshot update reflects internal code changes.

The line number change from 17 to 37 in the backtrace correctly reflects modifications to the cucumber/R/test.R file that shifted the location of the error call.

Also applies to: 339-339

R/normalize_feature.R (1)

8-16: Excellent bug fix! Keyword replacement now properly anchored to line starts.

The changes correctly implement anchored pattern matching that:

  • Only replaces keywords at the beginning of lines (with optional leading whitespace)
  • Preserves indentation by capturing and reusing whitespace with \\1
  • Prevents unintended replacements of keywords within step descriptions

This addresses the normalization issue documented in the changelog.

NEWS.md (1)

1-4: Well-documented changelog entry for the patch release.

The changelog correctly documents the 2.1.1 release with a clear description of the normalization bug fix and proper reference to the associated pull request.

@jakubsob jakubsob merged commit 3583e5f into main Jul 16, 2025
12 checks passed
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