Skip to content

Changes for unauth stream exclude in discovery - #64

Open
atttiwari wants to merge 2 commits into
gl-masterfrom
SAC-31244-unauth-stream-exclusion
Open

Changes for unauth stream exclude in discovery#64
atttiwari wants to merge 2 commits into
gl-masterfrom
SAC-31244-unauth-stream-exclusion

Conversation

@atttiwari

@atttiwari atttiwari commented Jul 6, 2026

Copy link
Copy Markdown

Description of change

This PR changes tap discovery behavior to skip streams that are inaccessible due to authorization (HTTP 403) rather than failing discovery, while still failing with an AuthorizationError if no streams are accessible.

Changes:

  • Added per-stream access probing (check_access) and discovery-time pruning of inaccessible streams (plus child-stream pruning).
  • Updated CLI behavior to surface AuthorizationError distinctly from AuthenticationError.
  • Added/adjusted unit tests and updated dependency pins + changelog entry.
  • Bump request and singer-python version
  • SAC-31244

Manual QA steps

  • Discovery: Running
  • Sync: Running
  • Unit tests: Running
  • Integration Tests: Running

Risks

Rollback steps

  • revert this branch

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR changes tap discovery behavior to skip streams that are inaccessible due to authorization (HTTP 403) rather than failing discovery, while still failing with an AuthorizationError if no streams are accessible.

Changes:

  • Added per-stream access probing (check_access) and discovery-time pruning of inaccessible streams (plus child-stream pruning).
  • Updated CLI behavior to surface AuthorizationError distinctly from AuthenticationError.
  • Added/adjusted unit tests and updated dependency pins + changelog entry.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/unittests/test_tap_braintree.py Adds tests around do_discover() and main() authentication/authorization error handling.
tests/unittests/test_discovery.py Adds unit tests covering access checks, child pruning, and discovery outcomes.
tap_braintree/streams.py Introduces check_access() to probe stream read permissions and treat 403 as inaccessible.
tap_braintree/discover.py Adds discovery-time filtering of inaccessible streams and raises AuthorizationError when none are accessible.
tap_braintree/init.py Adjusts do_discover() exception behavior and adds AuthorizationError handling in main().
setup.py Updates pinned versions for singer-python and requests.
CHANGELOG.md Documents the new “exclude forbidden streams during discovery” behavior and test additions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tap_braintree/__init__.py Outdated
Comment thread tap_braintree/discover.py Outdated
Comment on lines +61 to +62
"""Run the discovery mode, prepare the catalog file and return the
catalog."""
catalog. Streams the credentials cannot read are excluded from the catalog."""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

addressed

Comment thread tap_braintree/__init__.py
Comment thread tests/unittests/test_tap_braintree.py Outdated
Comment on lines 70 to 71
if __name__ == '__main__':
unittest.main()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

addressed

@atttiwari
atttiwari requested a review from RushiT0122 July 7, 2026 08:42
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