chore(plane): default project workspace to developments
This commit is contained in:
@@ -7,6 +7,7 @@ const MCP_PATH = path.join(__dirname, '..', '..', '.mcp.json');
|
||||
|
||||
const DEFAULT_PROJECT_ID = '643f7055-1237-4912-912f-99ec49fd0f0e';
|
||||
const DEFAULT_PROJECT_IDENTIFIER = 'MITHOME';
|
||||
const DEFAULT_WORKSPACE_SLUG = 'developments';
|
||||
|
||||
function loadDotEnv() {
|
||||
try {
|
||||
@@ -44,10 +45,16 @@ function getConfig() {
|
||||
return {
|
||||
apiKey: process.env.PLANE_API_KEY || mcp.PLANE_API_KEY,
|
||||
host: (process.env.PLANE_API_HOST_URL || mcp.PLANE_API_HOST_URL || 'https://pm.llmdev.mozdit.hu/').replace(/\/+$/, ''),
|
||||
workspace: process.env.PLANE_WORKSPACE_SLUG || mcp.PLANE_WORKSPACE_SLUG,
|
||||
workspace: resolveWorkspaceSlug(process.env, mcp),
|
||||
projectId: process.env.PLANE_PROJECT_ID || DEFAULT_PROJECT_ID,
|
||||
projectIdentifier: process.env.PLANE_PROJECT_IDENTIFIER || DEFAULT_PROJECT_IDENTIFIER
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = { getConfig, loadDotEnv };
|
||||
function resolveWorkspaceSlug(environment, mcpConfig) {
|
||||
// DECISION: workspace is project-scoped; prefer this repo's MCP config over
|
||||
// a workspace slug inherited from another active Conductor connection.
|
||||
return mcpConfig.PLANE_WORKSPACE_SLUG || environment.PLANE_WORKSPACE_SLUG || DEFAULT_WORKSPACE_SLUG;
|
||||
}
|
||||
|
||||
module.exports = { getConfig, loadDotEnv, resolveWorkspaceSlug };
|
||||
|
||||
@@ -3,6 +3,7 @@ const assert = require('node:assert/strict');
|
||||
|
||||
const { parseTodoFile, buildTable, regenerate, seqNum, SECTIONS } = require('./todo');
|
||||
const { groupToSection, buildDiscrepancies, buildFinalSections } = require('./sync');
|
||||
const { resolveWorkspaceSlug } = require('./config');
|
||||
|
||||
const SAMPLE_TODO = `# mozdIT Weboldal
|
||||
|
||||
@@ -47,6 +48,19 @@ Next.js 15 alapú weboldal.
|
||||
- **Frontend**: Next.js 15
|
||||
`;
|
||||
|
||||
test('resolveWorkspaceSlug defaults to the project workspace', () => {
|
||||
assert.equal(resolveWorkspaceSlug({}, {}), 'developments');
|
||||
});
|
||||
|
||||
test('resolveWorkspaceSlug prefers the project MCP config over inherited environment', () => {
|
||||
assert.equal(resolveWorkspaceSlug({ PLANE_WORKSPACE_SLUG: 'priws' }, { PLANE_WORKSPACE_SLUG: 'developments' }), 'developments');
|
||||
});
|
||||
|
||||
test('resolveWorkspaceSlug uses the environment when no project config is present', () => {
|
||||
assert.equal(resolveWorkspaceSlug({ PLANE_WORKSPACE_SLUG: 'custom' }, {}), 'custom');
|
||||
assert.equal(resolveWorkspaceSlug({}, { PLANE_WORKSPACE_SLUG: 'mcp' }), 'mcp');
|
||||
});
|
||||
|
||||
test('parseTodoFile parses sections and rows with notes', () => {
|
||||
const { sections, rows } = parseTodoFile(SAMPLE_TODO);
|
||||
assert.equal(sections.completed.rows.length, 2);
|
||||
|
||||
Reference in New Issue
Block a user