Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d6999ae
Initial plan
Copilot Feb 2, 2026
88619be
Add filtering for workflow command lines and tests
Copilot Feb 2, 2026
91d2ff8
Fix linting issues in test file
Copilot Feb 2, 2026
552833a
Simplify test to validate log line filtering behavior
Copilot Feb 2, 2026
b79f034
Refactor log line processing to separate module
Copilot Feb 2, 2026
03e12ea
Apply suggestion from @silverwind
silverwind Feb 2, 2026
4429a50
snapshots
silverwind Feb 2, 2026
6eaaed7
shorten
silverwind Feb 2, 2026
44b5b93
fix lint
silverwind Feb 2, 2026
4ed3f7d
reorder and document types
silverwind Feb 2, 2026
8500e58
restart ci
silverwind Feb 2, 2026
e3a6a6a
restart ci
silverwind Feb 3, 2026
75791e6
refactor test
silverwind Feb 3, 2026
d170c88
move actions log module from render/ to actions/
silverwind Feb 4, 2026
d80cec2
move functions into RepoActionView.vue
silverwind Feb 4, 2026
7b18e6a
Merge branch 'main' into copilot/hide-workflow-command-lines
silverwind Feb 4, 2026
7e7e3df
reorder
silverwind Feb 4, 2026
9b7acb7
reduce diff
silverwind Feb 4, 2026
1ba743e
reduce diff
silverwind Feb 4, 2026
9c533aa
remove unnecessary exports
silverwind Feb 4, 2026
f6b4a66
Revert formatting/comment noise
silverwind Feb 5, 2026
75c35c6
add tests
silverwind Feb 5, 2026
c5a5c49
rename test
silverwind Feb 5, 2026
1e4d60f
fix exports
silverwind Feb 5, 2026
1168e31
remove non-existant ::workflow-command::
silverwind Feb 5, 2026
36b9d1d
use realistic workflow command examples in test fixtures
silverwind Feb 5, 2026
8036b7b
Update web_src/js/components/RepoActionView.vue
wxiaoguang Feb 5, 2026
68832e1
Update web_src/js/components/RepoActionView.vue
wxiaoguang Feb 5, 2026
f9e7e4b
remove superfluos test
silverwind Feb 5, 2026
ae670e3
simplify test
silverwind Feb 5, 2026
29ab65c
Merge branch 'main' into copilot/hide-workflow-command-lines
silverwind Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions web_src/js/components/RepoActionView.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {shouldHideLine, type LogLine} from './RepoActionView.vue';

test('shouldHideLine', () => {
expect(([
{index: 1, message: 'Starting build process', timestamp: 1000},
{index: 2, message: '::add-matcher::/home/runner/go/pkg/mod/example.com/tool/matcher.json', timestamp: 1001},
{index: 3, message: 'Running tests...', timestamp: 1002},
{index: 4, message: '##[add-matcher]/opt/hostedtoolcache/go/1.25.7/x64/matchers.json', timestamp: 1003},
{index: 5, message: 'Test suite started', timestamp: 1004},
{index: 7, message: 'All tests passed', timestamp: 1006},
{index: 8, message: '::remove-matcher owner=go::', timestamp: 1007},
{index: 9, message: 'Build complete', timestamp: 1008},
] as Array<LogLine>).filter((line) => !shouldHideLine(line)).map((line) => line.message)).toMatchInlineSnapshot(`
[
"Starting build process",
"Running tests...",
"Test suite started",
"All tests passed",
"Build complete",
]
`);
});
17 changes: 16 additions & 1 deletion web_src/js/components/RepoActionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ type RunStatus = 'unknown' | 'waiting' | 'running' | 'success' | 'failure' | 'ca

type StepContainerElement = HTMLElement & {_stepLogsActiveContainer?: HTMLElement}

type LogLine = {
export type LogLine = {
index: number;
timestamp: number;
message: string;
};

// `##[group]` is from Azure Pipelines, just supported by the way. https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands
const LogLinePrefixesGroup = ['::group::', '##[group]'];
const LogLinePrefixesEndGroup = ['::endgroup::', '##[endgroup]'];
// https://github.com/actions/toolkit/blob/master/docs/commands.md
// https://github.com/actions/runner/blob/main/docs/adrs/0276-problem-matchers.md#registration
// Although there should be no `##[add-matcher]` syntax, there are still such outputs when using act-runner
const LogLinePrefixesHidden = ['::add-matcher::', '##[add-matcher]', '::remove-matcher'];

type LogLineCommand = {
name: 'group' | 'endgroup',
Expand Down Expand Up @@ -63,6 +68,15 @@ function parseLineCommand(line: LogLine): LogLineCommand | null {
return null;
}

export function shouldHideLine(line: LogLine): boolean {
for (const prefix of LogLinePrefixesHidden) {
if (line.message.startsWith(prefix)) {
return true;
}
}
return false;
}

function isLogElementInViewport(el: Element, {extraViewPortHeight}={extraViewPortHeight: 0}): boolean {
const rect = el.getBoundingClientRect();
// only check whether bottom is in viewport, because the log element can be a log group which is usually tall
Expand Down Expand Up @@ -315,6 +329,7 @@ export default defineComponent({

appendLogs(stepIndex: number, startTime: number, logLines: LogLine[]) {
for (const line of logLines) {
if (shouldHideLine(line)) continue;
const el = this.getActiveLogsContainer(stepIndex);
const cmd = parseLineCommand(line);
if (cmd?.name === 'group') {
Expand Down