Fetch milestones after search input#151
Open
subhajitlucky wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates milestone selection to avoid preloading all active milestones by first prompting for a search term and querying GitLab’s milestones API with that term, with a fallback to the full active milestone list when the search yields no results (Fixes #48).
Changes:
- Add a milestone search prompt before manual milestone selection and pass the query to the GitLab milestones API.
- Implement fallback behavior to fetch the full active milestone list when the search returns no matches.
- Add regression tests covering query encoding and fallback behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
gitHappens.py |
Adds search-aware milestone fetching and integrates a manual search prompt + fallback. |
tests/test_milestones.py |
Adds unit tests for milestone query encoding and fallback selection logic. |
tests/__init__.py |
Adds tests package marker for test discovery/imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+35
to
+40
| sys.modules["inquirer"] = inquirer_stub | ||
|
|
||
| spec = importlib.util.spec_from_file_location("gitHappens_under_test", root / "gitHappens.py") | ||
| module = importlib.util.module_from_spec(spec) | ||
| spec.loader.exec_module(module) | ||
| return module |
Comment on lines
+11
to
+23
| root = Path(__file__).resolve().parents[1] | ||
| config_dir = root / "configs" | ||
| config_dir.mkdir(exist_ok=True) | ||
| (config_dir / "config.ini").write_text( | ||
| "[DEFAULT]\n" | ||
| "base_url=https://gitlab.example\n" | ||
| "group_id=42\n" | ||
| "custom_template=Custom\n" | ||
| "GITLAB_TOKEN=test-token\n" | ||
| "squash_commits=true\n" | ||
| "delete_branch_after_merge=true\n", | ||
| encoding="utf-8", | ||
| ) |
Comment on lines
+24
to
+27
| (config_dir / "templates.json").write_text( | ||
| '{"templates": [], "reviewers": []}', | ||
| encoding="utf-8", | ||
| ) |
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.
Fixes #48.
Summary
Verification
python3 -m unittest tests.test_milestones -vpython3 -m unittest discover -vpython3 -m compileall gitHappens.py testsgit diff --check