Filter low-value columns from --md markdown output#311
Conversation
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)
There was a problem hiding this comment.
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()+skipMarkdownExtrato filter_urlcolumns and selected metadata fields from markdown tables. - Update
MarkdownRenderer.detectColumnsto use the new markdown-specific filtering. - Add/adjust unit tests to verify URL-column skipping and preservation of URL values in non-
_urlcolumns.
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.
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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
There was a problem hiding this comment.
💡 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.
There was a problem hiding this comment.
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*_urlcolumns from markdown tables (with explicit keep exceptions). - Update
MarkdownRenderer.detectColumnsto 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-*_urlfields.
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.
Summary
skipMarkdownColumn()helper toMarkdownRenderer.detectColumnsthat filters_urlsuffix columns and internal metadata fields (boosts_count,position,comments_count,attachable_sgid,personable_type,recording_type) from markdown table outputtypeandvisible_to_clientsintentionally kept (meaningful infiles listandrecordingsoutput)Test plan
TestMarkdownRenderTableSkipsURLColumns—_urlcolumns excluded from markdownTestMarkdownRenderTablePreservesURLValues— URL values in non-_urlcolumns surviveTestMarkdownTableSkipsLowValueColumns— all skip targets filteredTestMarkdownTableKeepsTypeColumn—typecolumn preservedSummary by cubic
Filters low-value columns from
--mdmarkdown tables to make output narrower and easier to read. Matches the styled table output, while keeping meaningful URL fields likebase_url,payload_url, anddownload_url._url-suffixed columns (exceptbase_url,payload_url,download_url) and internal fields:comments_count,boosts_count,position,attachable_sgid,personable_type,recording_type; preservestype.Written for commit f84b75b. Summary will update on new commits.