Skip to content

FakeOctokit pull request answers lose the nested base repository in dig lookups #1339

Description

@gemshrine

With testing: true, the fake pull request response does not expose the nested base repository values through the lookup used by the Octokit-facing code. A caller gets nil instead of the repository name and id, which can make tests or judges treat a pull request as belonging to no repository.

Steps to reproduce

  1. Enable Fbe testing mode and request a fake pull request, for example o.pull_request("zerocracy/baza", 42).
  2. Read pr.dig(:base, :repo, :full_name) and pr.dig(:base, :repo, :id).

Actual result

The lookup returns nil instead of the base repository values. test_fake_pull_request_base_repo_matches_requested_repo currently fails with expected "zerocracy/baza", actual nil.

Expected result

The fake response should preserve the nested base repository fields so the lookup returns the requested repository name and its integer id, matching the response shape consumed from Octokit.

Technical evidence

lib/fbe/fake_octokit.rb constructs the pull request response with base: { repo: repository(repo) }. PR #786 changed fake responses from hashes to Sawyer::Resource answers through lib/fbe/fake_octokit/sawyered.rb. The exact nested lookup fails in both Ubuntu and macOS rake jobs for PR #793 (run 36355562715).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions