Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
Falcon
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Walter Huang
Falcon
Commits
d78ba114
Commit
d78ba114
authored
Jun 26, 2025
by
Lin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: upload the JSON to the Google sheet
parent
41b63eb9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
16 deletions
+32
-16
package.json
package.json
+3
-1
diffWithDeepDiff.ts
src/detect_section_selector_masters/diffWithDeepDiff.ts
+21
-14
sendDiffToGoogleSheets.ts
...detect_section_selector_masters/sendDiffToGoogleSheets.ts
+8
-1
No files found.
package.json
View file @
d78ba114
...
...
@@ -31,6 +31,7 @@
"send-gsheet"
:
"bun run src/detect_section_selector_masters/sendDiffToGoogleSheets.ts"
,
"task:slack"
:
"bun run task && bun run send-diff"
,
"task:slack:ai"
:
"bun run task:ai && bun run send-diff"
,
"task:gsheet"
:
"bun run task && bun run send-gsheet"
"task:gsheet"
:
"bun run task && bun run send-gsheet"
,
"task:gsheet:ai"
:
"bun run task:ai && bun run send-gsheet"
}
}
\ No newline at end of file
src/detect_section_selector_masters/diffWithDeepDiff.ts
View file @
d78ba114
...
...
@@ -49,17 +49,24 @@ selectedSelectors
if
(
typeof
first
===
'number'
)
{
const
pageA
=
baselineData
[
first
]
||
{};
const
pageB
=
otherData
[
first
]
||
{};
context
[
selectedLanguages
[
baselineId
]]
=
{
pageUid
:
pageA
.
pageUid
,
pageTitle
:
pageA
.
pageTitle
,
sectionIndex
:
pageA
.
sectionIndex
};
context
[
selectedLanguages
[
otherId
]]
=
{
pageUid
:
pageB
.
pageUid
,
pageTitle
:
pageB
.
pageTitle
,
sectionIndex
:
pageB
.
sectionIndex
};
// Build flattened context keys with language prefix
const
langA
=
selectedLanguages
[
baselineId
];
const
langB
=
selectedLanguages
[
otherId
];
// pageUid, pageTitle, sectionIndex
context
[
`
${
langA
}
:subcategory`
]
=
pageA
.
pageTitle
;
context
[
`
${
langB
}
:subcategory`
]
=
pageB
.
pageTitle
;
context
[
`
${
langA
}
:sectionIndex`
]
=
pageA
.
sectionIndex
;
context
[
`
${
langB
}
:sectionIndex`
]
=
pageB
.
sectionIndex
;
context
[
`
${
langA
}
:pageUid`
]
=
pageA
.
pageUid
;
context
[
`
${
langB
}
:pageUid`
]
=
pageB
.
pageUid
;
const
idx
=
change
.
path
.
indexOf
(
'result'
);
if
(
idx
!==
-
1
)
{
const
itemIdx
=
change
.
path
[
idx
+
1
];
if
(
typeof
itemIdx
===
'number'
)
{
context
[
selectedLanguages
[
baselineId
]].
id
=
pageA
.
result
?.[
itemIdx
]?.
id
;
context
[
selectedLanguages
[
otherId
]].
id
=
pageB
.
result
?.[
itemIdx
]?.
id
;
context
[
selectedLanguages
[
baselineId
]].
path
=
pageA
.
result
?.[
itemIdx
]?.
path
;
context
[
selectedLanguages
[
otherId
]].
path
=
pageB
.
result
?.[
itemIdx
]?.
path
;
}
// Attach id and path with language prefix
context
[
`
${
langA
}
:id`
]
=
pageA
.
result
?.[
itemIdx
]?.
id
||
'Not Applicable'
;
context
[
`
${
langB
}
:id`
]
=
pageB
.
result
?.[
itemIdx
]?.
id
||
'Not Applicable'
;
context
[
`
${
langA
}
:path`
]
=
pageA
.
result
?.[
itemIdx
]?.
path
||
'Not Applicable'
;
context
[
`
${
langB
}
:path`
]
=
pageB
.
result
?.[
itemIdx
]?.
path
||
'Not Applicable'
;
}
}
return
{
...
change
,
context
};
...
...
@@ -69,7 +76,7 @@ selectedSelectors
const
semantic
=
annotated
.
map
(
change
=>
{
const
map
:
Record
<
string
,
string
>
=
{
E
:
'修改'
,
N
:
'新增'
,
D
:
'删除'
,
A
:
'数组类型的变更'
};
const
type
=
map
[
change
.
kind
]
||
change
.
kind
;
const
pathStr
=
(
change
.
path
||
[]).
map
(
seg
=>
typeof
seg
===
'number'
?
`[
${
seg
}
]`
:
seg
).
join
(
'.'
);
const
pathStr
=
(
change
.
path
||
[]).
filter
(
seg
=>
typeof
seg
!==
'number'
&&
seg
!==
'result'
).
join
(
'.'
);
let
oldV
:
any
,
newV
:
any
;
if
(
change
.
kind
===
'E'
)
{
oldV
=
(
change
as
any
).
lhs
;
...
...
@@ -85,11 +92,11 @@ selectedSelectors
newV
=
(
change
as
any
).
item
.
rhs
;
}
return
{
"更改类型"
:
type
,
"
问题类型"
:
pathStr
,
[
`
${
selectedLanguages
[
baselineId
]}
模版值`
]:
oldV
,
[
`
${
selectedLanguages
[
otherId
]}
模版值`
]:
newV
,
context
:
change
.
context
[
`
${
selectedLanguages
[
baselineId
]}
VS
${
selectedLanguages
[
otherId
]}
更改类型`
]:
type
,
"
字段类型"
:
pathStr
,
[
`
${
selectedLanguages
[
baselineId
]}
:模版值`
]:
oldV
||
'Not Applicable'
,
[
`
${
selectedLanguages
[
otherId
]}
:模版值`
]:
newV
||
'Not Applicable'
,
...
change
.
context
};
});
...
...
src/detect_section_selector_masters/sendDiffToGoogleSheets.ts
View file @
d78ba114
...
...
@@ -35,7 +35,14 @@ async function uploadAllToSheets() {
const
data
=
JSON
.
parse
(
raw
);
if
(
!
data
.
length
)
continue
;
const
headers
=
Object
.
keys
(
data
[
0
]);
const
rows
=
data
.
map
((
row
:
any
)
=>
headers
.
map
((
h
:
string
)
=>
row
[
h
]));
const
rows
=
data
.
map
((
row
:
any
)
=>
headers
.
map
((
h
:
string
)
=>
{
const
cell
=
row
[
h
];
return
cell
!=
null
&&
typeof
cell
===
'object'
?
JSON
.
stringify
(
cell
)
:
cell
;
})
);
// Clear existing values
await
sheets
.
spreadsheets
.
values
.
clear
({
spreadsheetId
,
range
:
`'
${
sheetName
}
'`
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment