8000 Fixed FieldTrait incorrectly sitting in the Drupal namespace. by AlexSkrypnyk · Pull Request #401 · drevops/behat-steps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixed FieldTrait incorrectly sitting in the Drupal namespace. #401

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025

Conversation

AlexSkrypnyk
Copy link
Member
@AlexSkrypnyk AlexSkrypnyk commented May 13, 2025

FieldTrait was incorrectly placed under Drupal namespace.

This PR fixes the location and updates docs.

A patch release will be done once this is merged.

Summary by CodeRabbit

  • Documentation
    • Updated documentation to reflect the transition of FieldTrait from a Drupal-specific trait to a generic trait, including changes in migration, README, and steps documentation.
  • Style
    • Updated namespace and import statements to use the generic FieldTrait instead of the Drupal-specific version.
    • Modified trait annotations in feature files to reference the generic FieldTrait.

Copy link
coderabbitai bot commented May 13, 2025

Walkthrough

The changes shift the FieldTrait from a Drupal-specific namespace to a generic one across code, documentation, and test files. All references, imports, and documentation entries are updated to reflect this namespace change, without altering the trait’s functionality or step definitions.

Changes

File(s) Change Summary
MIGRATION.md, README.md, STEPS.md Updated documentation to move FieldTrait from Drupal-specific to generic context; adjusted trait listings and sections accordingly.
src/FieldTrait.php Changed namespace from DrevOps\BehatSteps\Drupal to DrevOps\BehatSteps; updated docblock; removed redundant import.
tests/behat/bootstrap/FeatureContext.php Updated import statement for FieldTrait to use the new generic namespace.
tests/behat/features/field.feature Replaced all @trait:Drupal\FieldTrait annotations with @trait:FieldTrait in feature scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner
    participant FeatureContext
    participant FieldTrait

    TestRunner->>FeatureContext: Run scenario with @trait:FieldTrait
    FeatureContext->>FieldTrait: Use step definitions for form fields
    FieldTrait-->>FeatureContext: Provide field manipulation/assertion steps
    FeatureContext-->>TestRunner: Scenario executed using generic FieldTrait
Loading

Poem

A trait once wore a Drupal hat,
But now it’s free—imagine that!
Across the docs and code it spread,
A generic path it chose instead.
Fields rejoice, no bounds remain—
The namespace shift is your gain!
🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between f7596ae and cd199f9.

📒 Files selected for processing (6)
  • MIGRATION.md (1 hunks)
  • README.md (4 hunks)
  • STEPS.md (2 hunks)
  • src/FieldTrait.php (1 hunks)
  • tests/behat/bootstrap/FeatureContext.php (1 hunks)
  • tests/behat/features/field.feature (15 hunks)
🔇 Additional comments (9)
tests/behat/bootstrap/FeatureContext.php (1)

20-20: Updated import statement correctly for FieldTrait's new namespace.

The import statement has been updated to use the new generic namespace DrevOps\BehatSteps\FieldTrait instead of the previous Drupal-specific namespace. This change aligns with the PR's objective of moving FieldTrait out of the Drupal namespace.

MIGRATION.md (1)

86-86: Migration mapping updated correctly for FieldTrait.

The migration table header has been properly updated to reflect that FieldTrait now resides in the generic namespace rather than the Drupal-specific namespace. This ensures the migration documentation remains accurate and consistent with the code.

tests/behat/features/field.feature (1)

56-56: Trait annotations correctly updated throughout feature file.

All occurrences of the trait annotation have been properly updated from @trait:Drupal\FieldTrait to @trait:FieldTrait to reflect the namespace change. This ensures that the test scenarios remain correctly associated with the trait they're testing.

Also applies to: 70-70, 84-84, 98-98, 112-112, 173-173, 188-188, 203-203, 218-218, 233-233, 248-248, 263-263, 278-278, 293-293, 308-308

src/FieldTrait.php (3)

5-5: Namespace updated correctly.

The namespace has been properly updated from DrevOps\BehatSteps\Drupal to DrevOps\BehatSteps, moving the trait out of the Drupal-specific namespace into a generic one.


13-13: Updated documentation to match namespace change.

The docblock has been properly updated to remove the "Drupal" reference, changing from "Manipulate Drupal form fields" to "Manipulate form fields". This change is consistent with moving the trait to a generic namespace.


21-21: KeyboardTrait usage maintained properly.

The use KeyboardTrait; statement is now utilizing the trait from the same namespace since FieldTrait has been moved to the generic namespace where KeyboardTrait already existed. This simplifies the code by removing the need for an additional import.

README.md (2)

49-49: Consistent update: FieldTrait moved to generic steps index
The FieldTrait entry has been correctly added under "Index of Generic steps". The link STEPS.md#fieldtrait matches the corresponding section in STEPS.md, ensuring discoverability and consistency.


97-97: Approve positioning of AI migration prompt
The <details> block for the AI-guided migration prompt is now correctly positioned without extraneous blank lines, maintaining a clean flow in the README.

STEPS.md (1)

10-10: Consistent update: FieldTrait added to generic index
The FieldTrait entry is correctly placed under the "Index of Generic steps" with the proper anchor (#fieldtrait). This aligns with the namespace change and ensures users can locate the section easily.


🪧 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.
    • 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 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 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 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.

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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4eb70f2 and f7596ae.

📒 Files selected for processing (6)
  • MIGRATION.md (1 hunks)
  • README.md (1 hunks)
  • STEPS.md (2 hunks)
  • src/FieldTrait.php (1 hunks)
  • tests/behat/bootstrap/FeatureContext.php (1 hunks)
  • tests/behat/features/field.feature (15 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
STEPS.md

480-480: Multiple spaces after blockquote symbol
null

(MD027, no-multiple-space-blockquote)


481-481: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


481-481: Multiple spaces after blockquote symbol
null

(MD027, no-multiple-space-blockquote)


481-481: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


482-482: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


482-482: Multiple spaces after blockquote symbol
null

(MD027, no-multiple-space-blockquote)


483-483: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


483-483: Multiple spaces after blockquote symbol
null

(MD027, no-multiple-space-blockquote)


485-485: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


486-486: Inline HTML
Element: details

(MD033, no-inline-html)


487-487: Inline HTML
Element: summary

(MD033, no-inline-html)


487-487: Inline HTML
Element: code

(MD033, no-inline-html)


489-489: Inline HTML
Element: br

(MD033, no-inline-html)


491-491: Inline HTML
Element: br

(MD033, no-inline-html)


491-491: Inline HTML
Element: br

(MD033, no-inline-html)


500-500: Inline HTML
Element: details

(MD033, no-inline-html)


501-501: Inline HTML
Element: summary

(MD033, no-inline-html)


501-501: Inline HTML
Element: code

(MD033, no-inline-html)


503-503: Inline HTML
Element: br

(MD033, no-inline-html)


505-505: Inline HTML
Element: br

(MD033, no-inline-html)


505-505: Inline HTML
Element: br

(MD033, no-inline-html)


514-514: Inline HTML
Element: details

(MD033, no-inline-html)


515-515: Inline HTML
Element: summary

(MD033, no-inline-html)


515-515: Inline HTML
Element: code

(MD033, no-inline-html)


517-517: Inline HTML
Element: br

(MD033, no-inline-html)


519-519: Inline HTML
Element: br

(MD033, no-inline-html)


519-519: Inline HTML
Element: br

(MD033, no-inline-html)


529-529: Inline HTML
Element: details

(MD033, no-inline-html)


530-530: Inline HTML
Element: summary

(MD033, no-inline-html)


530-530: Inline HTML
Element: code

(MD033, no-inline-html)


532-532: Inline HTML
Element: br

(MD033, no-inline-html)


534-534: Inline HTML
Element: br

(MD033, no-inline-html)


534-534: Inline HTML
Element: br

(MD033, no-inline-html)


544-544: Inline HTML
Element: details

(MD033, no-inline-html)


545-545: Inline HTML
Element: summary

(MD033, no-inline-html)


545-545: Inline HTML
Element: code

(MD033, no-inline-html)


547-547: Inline HTML
Element: br

(MD033, no-inline-html)


549-549: Inline HTML
Element: br

(MD033, no-inline-html)


549-549: Inline HTML
Element: br

(MD033, no-inline-html)


561-561: Inline HTML
Element: details

(MD033, no-inline-html)


562-562: Inline HTML
Element: summary

(MD033, no-inline-html)


562-562: Inline HTML
Element: code

(MD033, no-inline-html)


564-564: Inline HTML
Element: br

(MD033, no-inline-html)


566-566: Inline HTML
Element: br

(MD033, no-inline-html)


566-566: Inline HTML
Element: br

(MD033, no-inline-html)


575-575: Inline HTML
Element: details

(MD033, no-inline-html)


576-576: Inline HTML
Element: summary

(MD033, no-inline-html)


576-576: Inline HTML
Element: code

(MD033, no-inline-html)


578-578: Inline HTML
Element: br

(MD033, no-inline-html)


580-580: Inline HTML
Element: br

(MD033, no-inline-html)


580-580: Inline HTML
Element: br

(MD033, no-inline-html)


589-589: Inline HTML
Element: details

(MD033, no-inline-html)


590-590: Inline HTML
Element: summary

(MD033, no-inline-html)


590-590: Inline HTML
Element: code

(MD033, no-inline-html)


592-592: Inline HTML
Element: br

(MD033, no-inline-html)


594-594: Inline HTML
Element: br

(MD033, no-inline-html)


594-594: Inline HTML
Element: br

(MD033, no-inline-html)


603-603: Inline HTML
Element: details

(MD033, no-inline-html)


604-604: Inline HTML
Element: summary

(MD033, no-inline-html)


604-604: Inline HTML
Element: code

(MD033, no-inline-html)


606-606: Inline HTML
Element: br

(MD033, no-inline-html)


608-608: Inline HTML
Element: br

(MD033, no-inline-html)


608-608: Inline HTML
Element: br

(MD033, no-inline-html)


617-617: Inline HTML
Element: details

(MD033, no-inline-html)


618-618: Inline HTML
Element: summary

(MD033, no-inline-html)


618-618: Inline HTML
Element: code

(MD033, no-inline-html)


620-620: Inline HTML
Element: br

(MD033, no-inline-html)


622-622: Inline HTML
Element: br

(MD033, no-inline-html)


622-622: Inline HTML
Element: br

(MD033, no-inline-html)

🔇 Additional comments (8)
tests/behat/bootstrap/FeatureContext.php (1)

20-20: Namespace import updated for FieldTrait
The import of FieldTrait has been correctly updated to the generic namespace DrevOps\BehatSteps\FieldTrait. This aligns with the refactoring plan and ensures the trait is loaded from its new location.

tests/behat/features/field.feature (1)

56-56: Trait annotations updated to generic namespace
All occurrences of the trait tag have been updated from @trait:Drupal\FieldTrait to @trait:FieldTrait. This change is consistent across scenarios and ensures the correct trait reference in feature files.

Also applies to: 70-70, 84-84, 98-98, 112-112, 173-173, 188-188, 203-203, 218-218, 233-233, 248-248, 263-263, 278-278, 293-293, 308-308

README.md (1)

49-49: Documentation updated to include generic FieldTrait
The FieldTrait entry has been added to the "Index of Generic steps", and its Drupal-specific entry removed. This accurately reflects the trait’s new generic placement.

MIGRATION.md (1)

86-86: Migration map corrected for FieldTrait
The migration documentation now maps to FieldTrait without the Drupal\ prefix, aligning with the namespace change in the code.

src/FieldTrait.php (2)

5-5: Namespace declaration updated
The namespace has been updated from DrevOps\BehatSteps\Drupal to DrevOps\BehatSteps, making FieldTrait a generic trait.


13-13: Docblock updated to remove Drupal-specific wording
The class-level docblock no longer references "Drupal", reflecting the trait’s broader applicability.

STEPS.md (2)

10-10: Verify the generic FieldTrait entry in the Generic steps index
The new | [FieldTrait](#fieldtrait) | Manipulate form fields and verify widget functionality. | entry correctly reflects the namespace change. Please confirm that the #fieldtrait anchor matches the newly added section below and that the description aligns with the trait’s functionality.


476-484: Confirm the new FieldTrait documentation section
The freshly inserted ## FieldTrait section mirrors the removed Drupal-specific block. Ensure that:

  • The title and link anchor (fieldtrait) match the index entry.
  • The step definitions and Gherkin examples accurately represent the moved trait.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

480-480: Multiple spaces after blockquote symbol
null

(MD027, no-multiple-space-blockquote)


481-481: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


481-481: Multiple spaces after blockquote symbol
null

(MD027, no-multiple-space-blockquote)


481-481: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


482-482: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


482-482: Multiple spaces after blockquote symbol
null

(MD027, no-multiple-space-blockquote)


483-483: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


483-483: Multiple spaces after blockquote symbol
null

(MD027, no-multiple-space-blockquote)

Copy link
codecov bot commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.29%. Comparing base (4eb70f2) to head (cd199f9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #401   +/-   ##
=======================================
  Coverage   80.29%   80.29%           
=======================================
  Files          29       29           
  Lines        1959     1959           
=======================================
  Hits         1573     1573           
  Misses        386      386           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/fix-fieldtrait-namespace branch from f7596ae to cd199f9 Compare May 13, 2025 23:49
@AlexSkrypnyk AlexSkrypnyk enabled auto-merge (rebase) May 13, 2025 23:51
@AlexSkrypnyk AlexSkrypnyk requested a review from skipper-vp May 13, 2025 23:52
@AlexSkrypnyk AlexSkrypnyk disabled auto-merge May 13, 2025 23:59
@AlexSkrypnyk AlexSkrypnyk enabled auto-merge (rebase) May 13, 2025 23:59
@AlexSkrypnyk AlexSkrypnyk merged commit 5e5083e into main May 14, 2025
5 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/fix-fieldtrait-namespace branch May 14, 2025 00:04
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.

2 participants
0