✨ feat(vscode): 摘修复识别 alembic 迁移,接不上发布分支链的高亮禁用不可摘
按 writing-alembic-migrations 的规矩判断:迁移的前任必须已在发布分支上, 且发布分支上该前任不能已有别的后继;根迁移接不上已有链、删迁移会断链也不可摘。 列表里带迁移的提交打「迁移」角标,不可摘的高亮警告色、禁用勾选并写明原因; 确认接口再校验一遍,绕过前端也摘不进去。 Claude-Session: https://claude.ai/code/session_01QWxLb6X8Vd2G5vHnp6R7qm
This commit is contained in:
1 parent
df0660cff7
commit
028195ab2b
8 files changed
+261
-26
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import type { ReleaseCommitGroup } from './messages'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { filterCherryPickGroups, uniqueAuthors } from './cherryPickView'
|
||||
import { filterCherryPickGroups, pickableShas, uniqueAuthors } from './cherryPickView'
|
||||
|
||||
const groups: ReleaseCommitGroup[] = [
|
||||
{
|
||||
@@ -35,3 +35,14 @@ describe('uniqueAuthors', () => {
|
||||
expect(uniqueAuthors(groups)).toEqual(['cruldra', 'chehongweo'])
|
||||
})
|
||||
})
|
||||
|
||||
describe('pickableShas', () => {
|
||||
it('带不兼容迁移的提交不能勾;兼容的迁移照常', () => {
|
||||
const commits = [
|
||||
{ sha: 'a', subject: 'ok', author: 'x', date: '', body: '' },
|
||||
{ sha: 'b', subject: 'mig ok', author: 'x', date: '', body: '', migration: { files: ['alembic/versions/0002.py'] } },
|
||||
{ sha: 'c', subject: 'mig bad', author: 'x', date: '', body: '', migration: { files: ['alembic/versions/0003.py'], blocked: '上游迁移 0002 不在 release/x' } },
|
||||
]
|
||||
expect(pickableShas(commits)).toEqual(['a', 'b'])
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user