Skip to content

Filter low-value columns from --md markdown output#311

Merged
jeremy merged 4 commits intomainfrom
bc-9679567315
Mar 16, 2026
Merged

Filter low-value columns from --md markdown output#311
jeremy merged 4 commits intomainfrom
bc-9679567315

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 16, 2026

Summary

  • Add skipMarkdownColumn() helper to MarkdownRenderer.detectColumns that filters _url suffix columns and internal metadata fields (boosts_count, position, comments_count, attachable_sgid, personable_type, recording_type) from markdown table output
  • Styled table renderer unchanged — it already handles this via terminal-width column pruning
  • type and visible_to_clients intentionally kept (meaningful in files list and recordings output)

Test plan

  • TestMarkdownRenderTableSkipsURLColumns_url columns excluded from markdown
  • TestMarkdownRenderTablePreservesURLValues — URL values in non-_url columns survive
  • TestMarkdownTableSkipsLowValueColumns — all skip targets filtered
  • TestMarkdownTableKeepsTypeColumntype column preserved
  • Styled table URL test unchanged
  • All unit tests pass
  • All 290 e2e tests pass

Summary by cubic

Filters low-value columns from --md markdown tables to make output narrower and easier to read. Matches the styled table output, while keeping meaningful URL fields like base_url, payload_url, and download_url.

  • New Features
    • Excludes _url-suffixed columns (except base_url, payload_url, download_url) and internal fields: comments_count, boosts_count, position, attachable_sgid, personable_type, recording_type; preserves type.
    • Adds tests for column skipping, URL allowlist exceptions, URL value preservation, and formatted headers.

Written for commit f84b75b. Summary will update on new commits.

jeremy added 2 commits March 15, 2026 18:52
Add skipMarkdownColumn() helper that excludes _url suffix columns
(subscription_url, bookmark_url, etc.) and internal metadata fields
(boosts_count, position, comments_count, attachable_sgid,
personable_type, recording_type) from MarkdownRenderer.detectColumns.

The styled table renderer already handles this via terminal-width-based
column pruning; this brings parity to --md output.
- Rename TestMarkdownRenderTablePreservesURLs to
  TestMarkdownRenderTableSkipsURLColumns (assert _url columns excluded)
- Add TestMarkdownRenderTablePreservesURLValues (URL values in
  non-_url columns survive)
- Add TestMarkdownTableSkipsLowValueColumns (all skip targets)
- Add TestMarkdownTableKeepsTypeColumn (type column preserved)
@jeremy jeremy requested a review from a team as a code owner March 16, 2026 01:57
Copilot AI review requested due to automatic review settings March 16, 2026 01:57
@github-actions github-actions bot added tests Tests (unit and e2e) output Output formatting and presentation labels Mar 16, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces noise in --md (markdown) table output by filtering out low-value/internal columns (especially _url-suffixed fields) while keeping meaningful fields like type.

Changes:

  • Add skipMarkdownColumn() + skipMarkdownExtra to filter _url columns and selected metadata fields from markdown tables.
  • Update MarkdownRenderer.detectColumns to use the new markdown-specific filtering.
  • Add/adjust unit tests to verify URL-column skipping and preservation of URL values in non-_url columns.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/output/render.go Introduces markdown-only column skipping logic and applies it to markdown table column detection.
internal/output/output_test.go Adds test coverage for markdown table column filtering and preserves existing styled behavior coverage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 757fd78914

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/output/output_test.go">

<violation number="1" location="internal/output/output_test.go:2286">
P1: These `NotContains` assertions are vacuously true — they check raw key names (e.g., `"comments_count"`) but the markdown renderer title-cases headers via `formatHeader()` (producing `"Comments Count"`). The test would pass even if `skipMarkdownColumn` were completely broken. Assert on the formatted header strings instead, as `TestMarkdownRenderTableSkipsURLColumns` does for `"Todolists Url"`.</violation>
</file>

<file name="internal/output/render.go">

<violation number="1" location="internal/output/render.go:399">
P2: The blanket `strings.HasSuffix(key, "_url")` filter is too broad — it strips semantically meaningful columns like `base_url` (used in profile list output) alongside the intended API-internal URL columns. Consider using an explicit skip-list for known low-value URL columns (like `subscription_url`, `bookmark_url`, `todolists_url`, etc.) or adding an allow-list exemption for `base_url`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

- Exempt base_url from _url suffix filter (used in profile list output)
- Fix test assertions to check formatted headers (Comments Count, not
  comments_count) so assertions are not vacuously true
- Add TestMarkdownTableKeepsBaseURLColumn
- Clarify comment: styled renderer may still show these columns when
  terminal width allows
@github-actions github-actions bot added the enhancement New feature or request label Mar 16, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83778e7b51

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

These are user-facing data fields (webhook endpoints, download links)
that should not be filtered from markdown tables.
Copilot AI review requested due to automatic review settings March 16, 2026 04:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR narrows --md markdown table output by filtering “low-value” columns (primarily internal metadata and most *_url fields), bringing markdown tables closer to the readability users already get from the styled renderer’s width-based pruning.

Changes:

  • Add skipMarkdownColumn() (plus allow/deny lists) to filter internal counters/type markers and most *_url columns from markdown tables (with explicit keep exceptions).
  • Update MarkdownRenderer.detectColumns to use the new skip logic.
  • Add/adjust unit tests to verify URL-column skipping, exception handling (base_url), and preservation of URL values in non-*_url fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
internal/output/render.go Introduces markdown-only column filtering (skipMarkdownColumn) and applies it during markdown column detection.
internal/output/output_test.go Adds focused tests covering markdown column skipping/keeping behavior and URL value preservation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeremy jeremy merged commit 653f02e into main Mar 16, 2026
30 checks passed
@jeremy jeremy deleted the bc-9679567315 branch March 16, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request output Output formatting and presentation tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants