Skip to content

Add :foobar accessor to AddRolePermission#516

Closed
gjtorikian wants to merge 1 commit into
mainfrom
oagen-edit-test
Closed

Add :foobar accessor to AddRolePermission#516
gjtorikian wants to merge 1 commit into
mainfrom
oagen-edit-test

Conversation

@gjtorikian

Copy link
Copy Markdown
Contributor

Summary

  • Adds a :foobar attribute to the attr_accessor declaration in WorkOS::AddRolePermission (lib/workos/authorization/add_role_permission.rb).
  • ⚠️ Note: this file is marked auto-generated by oagen ("Do not edit"), and commit 7af2b1c was added to prevent oagen files from being PR'ed.

Test plan

  • bundle exec rubocop lib/workos/authorization/add_role_permission.rb
  • bundle exec rspec (or the relevant spec) passes
  • Confirm this manual edit to a generated file is intended

@gjtorikian gjtorikian requested review from a team as code owners July 6, 2026 18:53
@gjtorikian gjtorikian requested a review from tribble July 6, 2026 18:53
@workos-sdk-automation

Copy link
Copy Markdown
Contributor

🤖 This pull request was closed automatically

It edits files that are auto-generated by oagen (each header marks it as generated — e.g. This file is auto-generated by oagen. Do not edit., or Code generated by oagen. DO NOT EDIT. for Go). Hand edits to generated code are overwritten the next time the SDK is regenerated from the OpenAPI spec, so they can't be merged.

Generated files changed outside their hand-maintainable regions:

  • lib/workos/authorization/add_role_permission.rb

What to do instead

  • Generated code (models, resources, client wiring): make the change upstream in the OpenAPI spec / oagen so it lands on the next regeneration.
  • Hand-maintained code inside a generated file: only the regions fenced by @oagen-ignore-start@oagen-ignore-end may be edited by hand. Keep your changes within those fences.

If you believe this was closed in error, a maintainer can reopen the PR.

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the generated WorkOS::AddRolePermission model. The main change is:

  • Adds foobar to the model’s attr_accessor list.

Confidence Score: 4/5

The change is small and localized, but it leaves the new accessor disconnected from initialization and serialization behavior.

Focused runtime evidence confirms the added field is ignored when constructing the model, while the rest of the change surface is limited to one generated model file.

lib/workos/authorization/add_role_permission.rb

T-Rex T-Rex Logs

What T-Rex did

  • I reproduced the foobar preservation issue when initializing AddRolePermission: slug is set to 's' but foobar remains nil, and to_h includes only slug.
  • I validated the accessor behavior by running a focused Ruby script that shows the before state with no foobar accessor and NoMethodError, and the after state where foobar accessor exists, the writer is functional, and reading returns 'x'.
  • I captured artifacts including the focused repro script and the failing output to support reviewers in inspecting the exact failure mode.
  • I captured the before/after accessor results and the exact Ruby scenario as artifacts to demonstrate the state transition.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. lib/workos/authorization/add_role_permission.rb, line 7-16 (link)

    P1 Wire the attribute
    foobar is exposed as a reader/writer but is not included in HASH_ATTRS or assigned in initialize. When callers construct WorkOS::AddRolePermission.new({ foobar: "x" }), the object still returns nil for foobar, so the new field is silently ignored.

    Artifacts

    Repro: focused Ruby script for AddRolePermission foobar initialization

    • Contains supporting evidence from the run (text/x-ruby; charset=utf-8).

    Repro: failing Ruby execution output showing foobar is nil

    • Keeps the command output available without making the summary code-heavy.

    View artifacts

    T-Rex Ran code and verified through T-Rex

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: lib/workos/authorization/add_role_permission.rb
    Line: 7-16
    
    Comment:
    **Wire the attribute**
    `foobar` is exposed as a reader/writer but is not included in `HASH_ATTRS` or assigned in `initialize`. When callers construct `WorkOS::AddRolePermission.new({ foobar: "x" })`, the object still returns `nil` for `foobar`, so the new field is silently ignored.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
lib/workos/authorization/add_role_permission.rb:7-16
**Wire the attribute**
`foobar` is exposed as a reader/writer but is not included in `HASH_ATTRS` or assigned in `initialize`. When callers construct `WorkOS::AddRolePermission.new({ foobar: "x" })`, the object still returns `nil` for `foobar`, so the new field is silently ignored.

Reviews (1): Last reviewed commit: "some fake PR" | Re-trigger Greptile

@gjtorikian gjtorikian deleted the oagen-edit-test branch July 6, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant