Skip to content

Commit 70f0a4f

Browse files
committed
feature-296-bugbot-autofix: Remove deprecated constants and utility functions across CLI and GitHub Action modules to streamline the codebase. This includes the elimination of the FileRepository class and related methods, enhancing maintainability and reducing complexity. Update logger and title utilities to reflect these changes.
1 parent 8f96f78 commit 70f0a4f

14 files changed

Lines changed: 6 additions & 116 deletions

File tree

build/cli/index.js

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -59045,9 +59045,8 @@ exports.CheckPullRequestCommentLanguageUseCase = CheckPullRequestCommentLanguage
5904559045
"use strict";
5904659046

5904759047
Object.defineProperty(exports, "__esModule", ({ value: true }));
59048-
exports.PROMPTS = exports.BUGBOT_MIN_SEVERITY = exports.BUGBOT_MAX_COMMENTS = exports.BUGBOT_MARKER_PREFIX = exports.ACTIONS = exports.ERRORS = exports.INPUT_KEYS = exports.WORKFLOW_ACTIVE_STATUSES = exports.WORKFLOW_STATUS = exports.DEFAULT_IMAGE_CONFIG = exports.OPENCODE_RETRY_DELAY_MS = exports.OPENCODE_MAX_RETRIES = exports.OPENCODE_REQUEST_TIMEOUT_MS = exports.OPENCODE_DEFAULT_MODEL = exports.REPO_URL = exports.TITLE = void 0;
59048+
exports.PROMPTS = exports.BUGBOT_MIN_SEVERITY = exports.BUGBOT_MAX_COMMENTS = exports.BUGBOT_MARKER_PREFIX = exports.ACTIONS = exports.ERRORS = exports.INPUT_KEYS = exports.WORKFLOW_ACTIVE_STATUSES = exports.WORKFLOW_STATUS = exports.DEFAULT_IMAGE_CONFIG = exports.OPENCODE_RETRY_DELAY_MS = exports.OPENCODE_MAX_RETRIES = exports.OPENCODE_REQUEST_TIMEOUT_MS = exports.OPENCODE_DEFAULT_MODEL = exports.TITLE = void 0;
5904959049
exports.TITLE = 'Copilot';
59050-
exports.REPO_URL = 'https://github.com/vypdev/copilot';
5905159050
/** Default OpenCode model: provider/modelID (e.g. opencode/kimi-k2.5-free). Reuse for CLI, action and Ai fallbacks. */
5905259051
exports.OPENCODE_DEFAULT_MODEL = 'opencode/kimi-k2.5-free';
5905359052
/** Timeout in ms for OpenCode HTTP requests (session create, message, diff). Agent calls can be slow (e.g. plan analyzing repo). */
@@ -59549,13 +59548,10 @@ exports.getRandomElement = getRandomElement;
5954959548
/***/ }),
5955059549

5955159550
/***/ 8836:
59552-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
59551+
/***/ ((__unused_webpack_module, exports) => {
5955359552

5955459553
"use strict";
5955559554

59556-
var __importDefault = (this && this.__importDefault) || function (mod) {
59557-
return (mod && mod.__esModule) ? mod : { "default": mod };
59558-
};
5955959555
Object.defineProperty(exports, "__esModule", ({ value: true }));
5956059556
exports.setGlobalLoggerDebug = setGlobalLoggerDebug;
5956159557
exports.setStructuredLogging = setStructuredLogging;
@@ -59566,8 +59562,6 @@ exports.logError = logError;
5956659562
exports.logDebugInfo = logDebugInfo;
5956759563
exports.logDebugWarning = logDebugWarning;
5956859564
exports.logDebugError = logDebugError;
59569-
exports.logSingleLine = logSingleLine;
59570-
const readline_1 = __importDefault(__nccwpck_require__(4521));
5957159565
let loggerDebug = false;
5957259566
let loggerRemote = false;
5957359567
let structuredLogging = false;
@@ -59655,15 +59649,6 @@ function logDebugError(message) {
5965559649
logError(message);
5965659650
}
5965759651
}
59658-
function logSingleLine(message) {
59659-
if (loggerRemote) {
59660-
console.log(message);
59661-
return;
59662-
}
59663-
readline_1.default.clearLine(process.stdout, 0);
59664-
readline_1.default.cursorTo(process.stdout, 0);
59665-
process.stdout.write(message);
59666-
}
5966759652

5966859653

5966959654
/***/ }),
@@ -59940,7 +59925,7 @@ function getTaskEmoji(taskId) {
5994059925
"use strict";
5994159926

5994259927
Object.defineProperty(exports, "__esModule", ({ value: true }));
59943-
exports.extractVersionFromBranch = exports.extractIssueNumberFromPush = exports.extractIssueNumberFromBranch = void 0;
59928+
exports.extractIssueNumberFromPush = exports.extractIssueNumberFromBranch = void 0;
5994459929
const logger_1 = __nccwpck_require__(8836);
5994559930
const extractIssueNumberFromBranch = (branchName) => {
5994659931
const match = branchName?.match(/[a-zA-Z]+\/([0-9]+)-.*/);
@@ -59964,17 +59949,6 @@ const extractIssueNumberFromPush = (branchName) => {
5996459949
return issueNumber;
5996559950
};
5996659951
exports.extractIssueNumberFromPush = extractIssueNumberFromPush;
59967-
const extractVersionFromBranch = (branchName) => {
59968-
const match = branchName?.match(/^[^/]+\/(\d+\.\d+\.\d+)$/);
59969-
if (match) {
59970-
return match[1];
59971-
}
59972-
else {
59973-
(0, logger_1.logDebugInfo)('No version found in the branch name.');
59974-
return undefined;
59975-
}
59976-
};
59977-
exports.extractVersionFromBranch = extractVersionFromBranch;
5997859952

5997959953

5998059954
/***/ }),
@@ -60295,14 +60269,6 @@ module.exports = require("querystring");
6029560269

6029660270
/***/ }),
6029760271

60298-
/***/ 4521:
60299-
/***/ ((module) => {
60300-
60301-
"use strict";
60302-
module.exports = require("readline");
60303-
60304-
/***/ }),
60305-
6030660272
/***/ 2781:
6030760273
/***/ ((module) => {
6030860274

build/cli/src/data/repository/file_repository.d.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

build/cli/src/utils/__tests__/file_utils.test.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/cli/src/utils/constants.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export declare const TITLE = "Copilot";
2-
export declare const REPO_URL = "https://github.com/vypdev/copilot";
32
/** Default OpenCode model: provider/modelID (e.g. opencode/kimi-k2.5-free). Reuse for CLI, action and Ai fallbacks. */
43
export declare const OPENCODE_DEFAULT_MODEL = "opencode/kimi-k2.5-free";
54
/** Timeout in ms for OpenCode HTTP requests (session create, message, diff). Agent calls can be slow (e.g. plan analyzing repo). */

build/cli/src/utils/file_utils.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

build/cli/src/utils/logger.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ export declare function logError(message: unknown, metadata?: Record<string, unk
1313
export declare function logDebugInfo(message: string, previousWasSingleLine?: boolean, metadata?: Record<string, unknown>): void;
1414
export declare function logDebugWarning(message: string): void;
1515
export declare function logDebugError(message: unknown): void;
16-
export declare function logSingleLine(message: string): void;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export declare const extractIssueNumberFromBranch: (branchName: string) => number;
22
export declare const extractIssueNumberFromPush: (branchName: string) => number;
3-
export declare const extractVersionFromBranch: (branchName: string) => string | undefined;

build/github_action/index.js

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -54353,9 +54353,8 @@ exports.CheckPullRequestCommentLanguageUseCase = CheckPullRequestCommentLanguage
5435354353
"use strict";
5435454354

5435554355
Object.defineProperty(exports, "__esModule", ({ value: true }));
54356-
exports.PROMPTS = exports.BUGBOT_MIN_SEVERITY = exports.BUGBOT_MAX_COMMENTS = exports.BUGBOT_MARKER_PREFIX = exports.ACTIONS = exports.ERRORS = exports.INPUT_KEYS = exports.WORKFLOW_ACTIVE_STATUSES = exports.WORKFLOW_STATUS = exports.DEFAULT_IMAGE_CONFIG = exports.OPENCODE_RETRY_DELAY_MS = exports.OPENCODE_MAX_RETRIES = exports.OPENCODE_REQUEST_TIMEOUT_MS = exports.OPENCODE_DEFAULT_MODEL = exports.REPO_URL = exports.TITLE = void 0;
54356+
exports.PROMPTS = exports.BUGBOT_MIN_SEVERITY = exports.BUGBOT_MAX_COMMENTS = exports.BUGBOT_MARKER_PREFIX = exports.ACTIONS = exports.ERRORS = exports.INPUT_KEYS = exports.WORKFLOW_ACTIVE_STATUSES = exports.WORKFLOW_STATUS = exports.DEFAULT_IMAGE_CONFIG = exports.OPENCODE_RETRY_DELAY_MS = exports.OPENCODE_MAX_RETRIES = exports.OPENCODE_REQUEST_TIMEOUT_MS = exports.OPENCODE_DEFAULT_MODEL = exports.TITLE = void 0;
5435754357
exports.TITLE = 'Copilot';
54358-
exports.REPO_URL = 'https://github.com/vypdev/copilot';
5435954358
/** Default OpenCode model: provider/modelID (e.g. opencode/kimi-k2.5-free). Reuse for CLI, action and Ai fallbacks. */
5436054359
exports.OPENCODE_DEFAULT_MODEL = 'opencode/kimi-k2.5-free';
5436154360
/** Timeout in ms for OpenCode HTTP requests (session create, message, diff). Agent calls can be slow (e.g. plan analyzing repo). */
@@ -54857,13 +54856,10 @@ exports.getRandomElement = getRandomElement;
5485754856
/***/ }),
5485854857

5485954858
/***/ 8836:
54860-
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
54859+
/***/ ((__unused_webpack_module, exports) => {
5486154860

5486254861
"use strict";
5486354862

54864-
var __importDefault = (this && this.__importDefault) || function (mod) {
54865-
return (mod && mod.__esModule) ? mod : { "default": mod };
54866-
};
5486754863
Object.defineProperty(exports, "__esModule", ({ value: true }));
5486854864
exports.setGlobalLoggerDebug = setGlobalLoggerDebug;
5486954865
exports.setStructuredLogging = setStructuredLogging;
@@ -54874,8 +54870,6 @@ exports.logError = logError;
5487454870
exports.logDebugInfo = logDebugInfo;
5487554871
exports.logDebugWarning = logDebugWarning;
5487654872
exports.logDebugError = logDebugError;
54877-
exports.logSingleLine = logSingleLine;
54878-
const readline_1 = __importDefault(__nccwpck_require__(4521));
5487954873
let loggerDebug = false;
5488054874
let loggerRemote = false;
5488154875
let structuredLogging = false;
@@ -54963,15 +54957,6 @@ function logDebugError(message) {
5496354957
logError(message);
5496454958
}
5496554959
}
54966-
function logSingleLine(message) {
54967-
if (loggerRemote) {
54968-
console.log(message);
54969-
return;
54970-
}
54971-
readline_1.default.clearLine(process.stdout, 0);
54972-
readline_1.default.cursorTo(process.stdout, 0);
54973-
process.stdout.write(message);
54974-
}
5497554960

5497654961

5497754962
/***/ }),
@@ -55427,7 +55412,7 @@ function getTaskEmoji(taskId) {
5542755412
"use strict";
5542855413

5542955414
Object.defineProperty(exports, "__esModule", ({ value: true }));
55430-
exports.extractVersionFromBranch = exports.extractIssueNumberFromPush = exports.extractIssueNumberFromBranch = void 0;
55415+
exports.extractIssueNumberFromPush = exports.extractIssueNumberFromBranch = void 0;
5543155416
const logger_1 = __nccwpck_require__(8836);
5543255417
const extractIssueNumberFromBranch = (branchName) => {
5543355418
const match = branchName?.match(/[a-zA-Z]+\/([0-9]+)-.*/);
@@ -55451,17 +55436,6 @@ const extractIssueNumberFromPush = (branchName) => {
5545155436
return issueNumber;
5545255437
};
5545355438
exports.extractIssueNumberFromPush = extractIssueNumberFromPush;
55454-
const extractVersionFromBranch = (branchName) => {
55455-
const match = branchName?.match(/^[^/]+\/(\d+\.\d+\.\d+)$/);
55456-
if (match) {
55457-
return match[1];
55458-
}
55459-
else {
55460-
(0, logger_1.logDebugInfo)('No version found in the branch name.');
55461-
return undefined;
55462-
}
55463-
};
55464-
exports.extractVersionFromBranch = extractVersionFromBranch;
5546555439

5546655440

5546755441
/***/ }),
@@ -55700,14 +55674,6 @@ module.exports = require("querystring");
5570055674

5570155675
/***/ }),
5570255676

55703-
/***/ 4521:
55704-
/***/ ((module) => {
55705-
55706-
"use strict";
55707-
module.exports = require("readline");
55708-
55709-
/***/ }),
55710-
5571155677
/***/ 2781:
5571255678
/***/ ((module) => {
5571355679

build/github_action/src/data/repository/file_repository.d.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

build/github_action/src/utils/__tests__/file_utils.test.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)