remove streams from catalog if not have permission#229
Open
mukeshbhatt18gl wants to merge 6 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates discovery to exclude streams from the generated catalog when the corresponding GitHub API endpoints are not accessible with the provided credentials (e.g., 403/404), aligning catalog output with actual permissions.
Changes:
- Add discovery-time probing of top-level stream endpoints and exclude inaccessible streams (and their descendants) from the catalog.
- Add a client helper (
check_stream_accessible) to test endpoint accessibility. - Update unit tests to accommodate the new discovery behavior and minor formatting tweaks.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
tap_github/discover.py |
Adds endpoint probing and stream exclusion logic during discovery. |
tap_github/client.py |
Introduces check_stream_accessible() helper used by discovery probing. |
tests/unittests/test_main.py |
Updates/extends discovery tests and cleans up whitespace. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…t repos, derive org from repo_path, broaden GithubException catch, fix test side_effect
RushiT0122
reviewed
May 11, 2026
Comment on lines
+53
to
+65
| inaccessible_streams = set() | ||
| if repo_path: | ||
| for stream_name, stream_class in STREAMS.items(): | ||
| stream_obj = stream_class() | ||
| if stream_obj.parent is None: | ||
| test_url = _build_access_check_url(client.base_url, stream_obj, repo_path, org) | ||
| if not client.check_stream_accessible(stream_name, test_url): | ||
| inaccessible_streams.add(stream_name) | ||
| LOGGER.warning( | ||
| "Stream '%s' will be excluded from the catalog: " | ||
| "insufficient permissions or resource not found.", | ||
| stream_name | ||
| ) |
Contributor
There was a problem hiding this comment.
discovery() method is handling mulitple responsibilities, please separate those out.
RushiT0122
requested changes
May 11, 2026
Contributor
RushiT0122
left a comment
There was a problem hiding this comment.
Made some suggestions inline.
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
SAC-30778
Manual QA steps
Risks
Rollback steps
AI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code