Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates two nearly identical classes (GithubToGitea and GithubToGiteaCF) into a single configurable class to reduce code duplication and improve maintainability. The refactored class now optionally supports Cloudflare Access when credentials are provided.
- Unified
GithubToGiteaandGithubToGiteaCFinto single class with optional Cloudflare support - Added
from_configclass method to simplify configuration parsing across scripts - Updated all scripts to use the new helper method, removing duplicated instantiation code
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/core/github_to_gitea.py | Enhanced with optional Cloudflare support, comprehensive documentation, and from_config helper method |
| scripts/core/github_to_gitea_cf.py | Removed entire file as functionality merged into main class |
| scripts/scrape_organization_cf.py | Updated to use unified class with Cloudflare enabled via from_config |
| scripts/scrape_organization.py | Simplified instantiation using from_config method |
| scripts/interactive.py | Simplified instantiation using from_config method |
| scripts/clone_github_stars.py | Simplified instantiation using from_config method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| try: # pragma: no cover - optional dependency | ||
| from core.cf_ready.cf_gitea import CFGitea | ||
| except Exception: # ImportError or any other error |
There was a problem hiding this comment.
Catching Exception is too broad. Consider catching specific exceptions like ImportError or ModuleNotFoundError that would occur when the optional dependency is missing.
Suggested change
| except Exception: # ImportError or any other error | |
| except (ImportError, ModuleNotFoundError): # Only catch missing module errors |
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.
Summary
from_confighelper to simplify script setupTesting
python -m py_compile scripts/core/github_to_gitea.py scripts/clone_github_stars.py scripts/interactive.py scripts/scrape_organization.py scripts/scrape_organization_cf.pyhttps://chatgpt.com/codex/tasks/task_e_68ad4f276284833195e33686637e9b42