Added stream access check in discovery#16
Open
rsaha-qlik wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds discovery-time stream access filtering so the tap’s catalog excludes streams that the authenticated token cannot access, while keeping the existing behavior when discovery is run without a client.
Changes:
- Updated
discover(client=None)to probe stream access and exclude streams that raiseSaaSOpticsForbiddenError, failing discovery if none are accessible. - Wired CLI discovery to pass the authenticated
SaaSOpticsClientinto discovery. - Added unit tests for the new discovery access behavior and bumped release metadata (version + changelog).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tap_saasoptics/discover.py |
Adds optional client-based access checks and filtering during catalog generation. |
tap_saasoptics/__init__.py |
Passes the authenticated client into discovery when running in --discover mode. |
tests/unittests/test_discover.py |
Adds unit coverage for filtering/raising behavior when a client is provided. |
setup.py |
Bumps package version to 1.3.0. |
CHANGELOG.md |
Documents the new discovery stream exclusion behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Changelog | ||
|
|
||
| ## 1.3.0 | ||
| * Exclude inaccessible streams during discovery and fail discovery when no streams are accessible. [#16] (http://github.com/singer-io/tap-saasoptics/pull/16) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
https://qlik-dev.atlassian.net/browse/SAC-31239
Summary
This PR adds discovery-time stream access filtering to
tap-saasopticsso inaccessible streams are excluded from the catalog, while preserving existing behavior when no client is provided.What changed
discover(client=None):GETcalls.SaaSOpticsForbiddenError.SaaSOpticsForbiddenErrorif no streams are accessible.do_discover(client)).1.3.0.Why
Some SaaSOptics accounts have partial API permissions. This prevents discovery from failing entirely when only some streams are restricted, while still failing clearly when nothing is accessible.
Validation
Ran targeted unit tests:
../env/Scripts/python.exe -m pytest tests/unittests/test_discover.py tests/unittests/test_client.py tests/unittests/test_sync.pyResult:
39 passed(with existing deprecation warnings unrelated to this change)Notes
discover()without a client.Manual QA steps
Risks
Rollback steps
AI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code