Skip to content

Commit 45c5392

Browse files
Copilotalexr00
andauthored
Add devMode setting to prevent rate limiting during development (#8304)
* Initial plan * Add devMode setting to limit expensive API calls - Adds githubPullRequests.devMode boolean setting (default: false) - When enabled, skips automatic Copilot PR status polling - Collapses all PR query categories by default - Disables issues fetching to reduce API calls - Helps prevent rate limiting during extension development Co-authored-by: alexr00 <[email protected]> * Simplify check in category node * Move dev mode check to doInitialize instead of setIssueData Check dev mode once at initialization time rather than in each setIssueData call. This is more efficient and cleaner. Co-authored-by: alexr00 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: alexr00 <[email protected]>
1 parent b2c731e commit 45c5392

File tree

7 files changed

+1286
-1252
lines changed

7 files changed

+1286
-1252
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,11 @@
617617
"markdownDescription": "%githubPullRequests.webviewRefreshInterval.description%",
618618
"default": 60
619619
},
620+
"githubPullRequests.devMode": {
621+
"type": "boolean",
622+
"markdownDescription": "%githubPullRequests.devMode.description%",
623+
"default": false
624+
},
620625
"githubIssues.ignoreMilestones": {
621626
"type": "array",
622627
"default": [],

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"githubPullRequests.experimental.notificationsMarkPullRequests.description": "Adds an action in the Notifications view to mark pull requests with no non-empty reviews, comments, or commits since you last viewed the pull request as read.",
104104
"githubPullRequests.experimental.useQuickChat.description": "Controls whether the Copilot \"Summarize\" commands in the Pull Requests, Issues, and Notifications views will use quick chat. Only has an effect if `#githubPullRequests.experimental.chat#` is enabled.",
105105
"githubPullRequests.webviewRefreshInterval.description": "The interval, in seconds, at which the pull request and issues webviews are refreshed when the webview is the active tab.",
106+
"githubPullRequests.devMode.description": "When enabled, limits expensive API calls to prevent hitting rate limits during extension development. Disables automatic Copilot PR status polling, collapses all PR query results, and disables issue fetching.",
106107
"githubIssues.ignoreMilestones.description": "An array of milestones titles to never show issues from.",
107108
"githubIssues.createIssueTriggers.description": "Strings that will cause the 'Create issue from comment' code action to show.",
108109
"githubIssues.createIssueTriggers.items": "String that enables the 'Create issue from comment' code action. Should not contain whitespace.",

src/common/settingKeys.ts

Lines changed: 104 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,105 @@
1-
/*---------------------------------------------------------------------------------------------
2-
* Copyright (c) Microsoft Corporation. All rights reserved.
3-
* Licensed under the MIT License. See License.txt in the project root for license information.
4-
*--------------------------------------------------------------------------------------------*/
5-
6-
export const PR_SETTINGS_NAMESPACE = 'githubPullRequests';
7-
export const TERMINAL_LINK_HANDLER = 'terminalLinksHandler';
8-
export const BRANCH_PUBLISH = 'createOnPublishBranch';
9-
export const BRANCH_LIST_TIMEOUT = 'branchListTimeout';
10-
export const USE_REVIEW_MODE = 'useReviewMode';
11-
export const FILE_LIST_LAYOUT = 'fileListLayout';
12-
export const HIDE_VIEWED_FILES = 'hideViewedFiles';
13-
export const ASSIGN_TO = 'assignCreated';
14-
export const PUSH_BRANCH = 'pushBranch';
15-
export const IGNORE_PR_BRANCHES = 'ignoredPullRequestBranches';
16-
export const IGNORE_SUBMODULES = 'ignoreSubmodules';
17-
export const NEVER_IGNORE_DEFAULT_BRANCH = 'neverIgnoreDefaultBranch';
18-
export const OVERRIDE_DEFAULT_BRANCH = 'overrideDefaultBranch';
19-
export const PULL_BRANCH = 'pullBranch';
20-
export const PULL_REQUEST_DESCRIPTION = 'pullRequestDescription';
21-
export const NOTIFICATION_SETTING = 'notifications';
22-
export type NotificationVariants = 'off' | 'pullRequests';
23-
export const POST_CREATE = 'postCreate';
24-
export const POST_DONE = 'postDone';
25-
export const QUERIES = 'queries';
26-
export const PULL_REQUEST_LABELS = 'labelCreated';
27-
export const FOCUSED_MODE = 'focusedMode';
28-
export const CREATE_DRAFT = 'createDraft';
29-
export const QUICK_DIFF = 'quickDiff';
30-
export const SET_AUTO_MERGE = 'setAutoMerge';
31-
export const SHOW_PULL_REQUEST_NUMBER_IN_TREE = 'showPullRequestNumberInTree';
32-
export const DEFAULT_MERGE_METHOD = 'defaultMergeMethod';
33-
export const DEFAULT_DELETION_METHOD = 'defaultDeletionMethod';
34-
export const SELECT_LOCAL_BRANCH = 'selectLocalBranch';
35-
export const SELECT_REMOTE = 'selectRemote';
36-
export const DELETE_BRANCH_AFTER_MERGE = 'deleteBranchAfterMerge';
37-
export const REMOTES = 'remotes';
38-
export const PULL_PR_BRANCH_BEFORE_CHECKOUT = 'pullPullRequestBranchBeforeCheckout';
39-
export type PullPRBranchVariants = 'never' | 'pull' | 'pullAndMergeBase' | 'pullAndUpdateBase' | true | false;
40-
export const UPSTREAM_REMOTE = 'upstreamRemote';
41-
export const DEFAULT_CREATE_OPTION = 'defaultCreateOption';
42-
export const CREATE_BASE_BRANCH = 'createDefaultBaseBranch';
43-
44-
export const ISSUES_SETTINGS_NAMESPACE = 'githubIssues';
45-
export const ASSIGN_WHEN_WORKING = 'assignWhenWorking';
46-
export const ISSUE_COMPLETIONS = 'issueCompletions';
47-
export const USER_COMPLETIONS = 'userCompletions';
48-
export const ENABLED = 'enabled';
49-
export const IGNORE_USER_COMPLETION_TRIGGER = 'ignoreUserCompletionTrigger';
50-
export const CREATE_INSERT_FORMAT = 'createInsertFormat';
51-
export const ISSUE_BRANCH_TITLE = 'issueBranchTitle';
52-
export const USE_BRANCH_FOR_ISSUES = 'useBranchForIssues';
53-
export const WORKING_BASE_BRANCH = 'workingBaseBranch';
54-
export const WORKING_ISSUE_FORMAT_SCM = 'workingIssueFormatScm';
55-
export const IGNORE_COMPLETION_TRIGGER = 'ignoreCompletionTrigger';
56-
export const ISSUE_COMPLETION_FORMAT_SCM = 'issueCompletionFormatScm';
57-
export const CREATE_ISSUE_TRIGGERS = 'createIssueTriggers';
58-
export const DEFAULT = 'default';
59-
export const IGNORE_MILESTONES = 'ignoreMilestones';
60-
export const ALLOW_FETCH = 'allowFetch';
61-
export const ALWAYS_PROMPT_FOR_NEW_ISSUE_REPO = 'alwaysPromptForNewIssueRepo';
62-
export const ISSUE_AVATAR_DISPLAY = 'issueAvatarDisplay';
63-
export const EXPERIMENTAL_CHAT = 'experimental.chat';
64-
export const EXPERIMENTAL_USE_QUICK_CHAT = 'experimental.useQuickChat';
65-
export const EXPERIMENTAL_NOTIFICATIONS_PAGE_SIZE = 'experimental.notificationsViewPageSize';
66-
export const EXPERIMENTAL_NOTIFICATIONS_SCORE = 'experimental.notificationsScore';
67-
export const WEBVIEW_REFRESH_INTERVAL = 'webviewRefreshInterval';
68-
69-
// git
70-
export const GIT = 'git';
71-
export const PULL_BEFORE_CHECKOUT = 'pullBeforeCheckout';
72-
export const OPEN_DIFF_ON_CLICK = 'openDiffOnClick';
73-
export const SHOW_INLINE_OPEN_FILE_ACTION = 'showInlineOpenFileAction';
74-
export const AUTO_STASH = 'autoStash';
75-
export const BRANCH_WHITESPACE_CHAR = 'branchWhitespaceChar';
76-
export const BRANCH_RANDOM_NAME_DICTIONARY = 'branchRandomName.dictionary';
77-
78-
// GitHub Enterprise
79-
export const GITHUB_ENTERPRISE = 'github-enterprise';
80-
export const URI = 'uri';
81-
82-
// Editor
83-
export const EDITOR = 'editor';
84-
export const WORD_WRAP = 'wordWrap';
85-
86-
// Comments
87-
export const COMMENTS = 'comments';
88-
export const OPEN_VIEW = 'openView';
89-
90-
// Explorer
91-
export const EXPLORER = 'explorer';
92-
export const AUTO_REVEAL = 'autoReveal';
93-
94-
// Workbench
95-
export const WORKBENCH = 'workbench';
96-
export const COLOR_THEME = 'colorTheme';
97-
98-
// Coding Agent
99-
100-
export const CODING_AGENT = `${PR_SETTINGS_NAMESPACE}.codingAgent`;
101-
export const CODING_AGENT_ENABLED = 'enabled';
102-
export const CODING_AGENT_AUTO_COMMIT_AND_PUSH = 'autoCommitAndPush';
103-
export const CODING_AGENT_PROMPT_FOR_CONFIRMATION = 'promptForConfirmation';
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
export const PR_SETTINGS_NAMESPACE = 'githubPullRequests';
7+
export const TERMINAL_LINK_HANDLER = 'terminalLinksHandler';
8+
export const BRANCH_PUBLISH = 'createOnPublishBranch';
9+
export const BRANCH_LIST_TIMEOUT = 'branchListTimeout';
10+
export const USE_REVIEW_MODE = 'useReviewMode';
11+
export const FILE_LIST_LAYOUT = 'fileListLayout';
12+
export const HIDE_VIEWED_FILES = 'hideViewedFiles';
13+
export const ASSIGN_TO = 'assignCreated';
14+
export const PUSH_BRANCH = 'pushBranch';
15+
export const IGNORE_PR_BRANCHES = 'ignoredPullRequestBranches';
16+
export const IGNORE_SUBMODULES = 'ignoreSubmodules';
17+
export const NEVER_IGNORE_DEFAULT_BRANCH = 'neverIgnoreDefaultBranch';
18+
export const OVERRIDE_DEFAULT_BRANCH = 'overrideDefaultBranch';
19+
export const PULL_BRANCH = 'pullBranch';
20+
export const PULL_REQUEST_DESCRIPTION = 'pullRequestDescription';
21+
export const NOTIFICATION_SETTING = 'notifications';
22+
export type NotificationVariants = 'off' | 'pullRequests';
23+
export const POST_CREATE = 'postCreate';
24+
export const POST_DONE = 'postDone';
25+
export const QUERIES = 'queries';
26+
export const PULL_REQUEST_LABELS = 'labelCreated';
27+
export const FOCUSED_MODE = 'focusedMode';
28+
export const CREATE_DRAFT = 'createDraft';
29+
export const QUICK_DIFF = 'quickDiff';
30+
export const SET_AUTO_MERGE = 'setAutoMerge';
31+
export const SHOW_PULL_REQUEST_NUMBER_IN_TREE = 'showPullRequestNumberInTree';
32+
export const DEFAULT_MERGE_METHOD = 'defaultMergeMethod';
33+
export const DEFAULT_DELETION_METHOD = 'defaultDeletionMethod';
34+
export const SELECT_LOCAL_BRANCH = 'selectLocalBranch';
35+
export const SELECT_REMOTE = 'selectRemote';
36+
export const DELETE_BRANCH_AFTER_MERGE = 'deleteBranchAfterMerge';
37+
export const REMOTES = 'remotes';
38+
export const PULL_PR_BRANCH_BEFORE_CHECKOUT = 'pullPullRequestBranchBeforeCheckout';
39+
export type PullPRBranchVariants = 'never' | 'pull' | 'pullAndMergeBase' | 'pullAndUpdateBase' | true | false;
40+
export const UPSTREAM_REMOTE = 'upstreamRemote';
41+
export const DEFAULT_CREATE_OPTION = 'defaultCreateOption';
42+
export const CREATE_BASE_BRANCH = 'createDefaultBaseBranch';
43+
44+
export const ISSUES_SETTINGS_NAMESPACE = 'githubIssues';
45+
export const ASSIGN_WHEN_WORKING = 'assignWhenWorking';
46+
export const ISSUE_COMPLETIONS = 'issueCompletions';
47+
export const USER_COMPLETIONS = 'userCompletions';
48+
export const ENABLED = 'enabled';
49+
export const IGNORE_USER_COMPLETION_TRIGGER = 'ignoreUserCompletionTrigger';
50+
export const CREATE_INSERT_FORMAT = 'createInsertFormat';
51+
export const ISSUE_BRANCH_TITLE = 'issueBranchTitle';
52+
export const USE_BRANCH_FOR_ISSUES = 'useBranchForIssues';
53+
export const WORKING_BASE_BRANCH = 'workingBaseBranch';
54+
export const WORKING_ISSUE_FORMAT_SCM = 'workingIssueFormatScm';
55+
export const IGNORE_COMPLETION_TRIGGER = 'ignoreCompletionTrigger';
56+
export const ISSUE_COMPLETION_FORMAT_SCM = 'issueCompletionFormatScm';
57+
export const CREATE_ISSUE_TRIGGERS = 'createIssueTriggers';
58+
export const DEFAULT = 'default';
59+
export const IGNORE_MILESTONES = 'ignoreMilestones';
60+
export const ALLOW_FETCH = 'allowFetch';
61+
export const ALWAYS_PROMPT_FOR_NEW_ISSUE_REPO = 'alwaysPromptForNewIssueRepo';
62+
export const ISSUE_AVATAR_DISPLAY = 'issueAvatarDisplay';
63+
export const EXPERIMENTAL_CHAT = 'experimental.chat';
64+
export const EXPERIMENTAL_USE_QUICK_CHAT = 'experimental.useQuickChat';
65+
export const EXPERIMENTAL_NOTIFICATIONS_PAGE_SIZE = 'experimental.notificationsViewPageSize';
66+
export const EXPERIMENTAL_NOTIFICATIONS_SCORE = 'experimental.notificationsScore';
67+
export const WEBVIEW_REFRESH_INTERVAL = 'webviewRefreshInterval';
68+
export const DEV_MODE = 'devMode';
69+
70+
// git
71+
export const GIT = 'git';
72+
export const PULL_BEFORE_CHECKOUT = 'pullBeforeCheckout';
73+
export const OPEN_DIFF_ON_CLICK = 'openDiffOnClick';
74+
export const SHOW_INLINE_OPEN_FILE_ACTION = 'showInlineOpenFileAction';
75+
export const AUTO_STASH = 'autoStash';
76+
export const BRANCH_WHITESPACE_CHAR = 'branchWhitespaceChar';
77+
export const BRANCH_RANDOM_NAME_DICTIONARY = 'branchRandomName.dictionary';
78+
79+
// GitHub Enterprise
80+
export const GITHUB_ENTERPRISE = 'github-enterprise';
81+
export const URI = 'uri';
82+
83+
// Editor
84+
export const EDITOR = 'editor';
85+
export const WORD_WRAP = 'wordWrap';
86+
87+
// Comments
88+
export const COMMENTS = 'comments';
89+
export const OPEN_VIEW = 'openView';
90+
91+
// Explorer
92+
export const EXPLORER = 'explorer';
93+
export const AUTO_REVEAL = 'autoReveal';
94+
95+
// Workbench
96+
export const WORKBENCH = 'workbench';
97+
export const COLOR_THEME = 'colorTheme';
98+
99+
// Coding Agent
100+
101+
export const CODING_AGENT = `${PR_SETTINGS_NAMESPACE}.codingAgent`;
102+
export const CODING_AGENT_ENABLED = 'enabled';
103+
export const CODING_AGENT_AUTO_COMMIT_AND_PUSH = 'autoCommitAndPush';
104+
export const CODING_AGENT_PROMPT_FOR_CONFIRMATION = 'promptForConfirmation';
104105
export const SHOW_CODE_LENS = 'codeLens';

0 commit comments

Comments
 (0)