Skip to content

feat(sync): improve content sync PR summary#6

Merged
sonupreetam merged 2 commits intocomplytime:mainfrom
sonupreetam:feat/improve-sync-summary
Apr 1, 2026
Merged

feat(sync): improve content sync PR summary#6
sonupreetam merged 2 commits intocomplytime:mainfrom
sonupreetam:feat/improve-sync-summary

Conversation

@sonupreetam
Copy link
Copy Markdown
Contributor

@sonupreetam sonupreetam commented Mar 30, 2026

Summary

The weekly content sync PR (sync-content-check.yml) currently produces a minimal summary — just repo names and a single "synced" counter that conflates repos with files. This makes it hard for reviewers to understand what changed.

Dependency: #4
Issue first appeared in: #5

This PR enhances toMarkdown() to produce a rich, actionable summary:

  • Linked repo names with descriptions and pinned commit SHA links
  • Compare URLs for updated repos (old_sha...new_sha) so reviewers can click through to see upstream changes
  • Separate counters for repositories vs files processed (previously a single misleading "synced" count)
  • Collapsible file manifest listing every synced file per repo
  • Collapsible unchanged section to reduce noise while keeping full context available

Before

## Content Sync Summary

### New Repositories

- `complyctl`
- `complyscribe`

**Stats**: 37 synced, 7 skipped

After

## Content Sync Summary

### New Repositories

- [`complyctl`](https://github.com/complytime/complyctl) — CLI for compliance
  - Pinned to [`9515e3da`](https://github.com/complytime/complyctl/commit/9515e3da...)
- [`complyscribe`](https://github.com/complytime/complyscribe) — Compliance authoring tool
  - Pinned to [`e04417ca`](https://github.com/complytime/complyscribe/commit/e04417ca...)

**Repositories**: 4 synced, 7 skipped
**Files processed**: 33

<details>
<summary>Synced files (33 across 4 repositories)</summary>

**complyctl** (12 files)
- `docs/installation.md`
- `docs/usage.md`
...
</details>

Changes

  • sync.go: Add repoSummary struct, repoFiles tracking, filesProcessed counter, rich toMarkdown() with helper methods
  • main.go: Enrich repo details with old SHAs from the lock before generating the summary
  • sync_test.go: 13 new test functions covering all summary variations

Test plan

  • go vet ./... — clean
  • gofmt -l . — clean
  • go test -race -count=1 ./... — all tests pass (existing + 13 new)
  • Verify rendered markdown in a real sync PR after merge

Made with Cursor

@sonupreetam sonupreetam force-pushed the feat/improve-sync-summary branch from 6ec9e50 to 4506374 Compare March 30, 2026 11:44
@sonupreetam sonupreetam force-pushed the feat/improve-sync-summary branch from 3b2cb9e to bb906de Compare March 30, 2026 14:49
Copy link
Copy Markdown

@marcusburghardt marcusburghardt left a comment

Choose a reason for hiding this comment

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

@sonupreetam , the code LGTM but I think for next updates ideally we should create a new spec in specs instead of updating already merged specs. This help us to keep the history of changes more transparent and easier to follow. Also, the incremental specs are expected to be much smaller and easier to review.

@sonupreetam
Copy link
Copy Markdown
Contributor Author

@marcusburghardt Apologies for the confusion there. After PR #4 merges and we rebase PR #6 onto main, the diff will shrink to just the 2 commits that are truly PR #6's work. So the previous spec is truly PR #4 work. But you are right to point out about the incremental specs for this PR. So, I would add the specs with the next PR.

@sonupreetam sonupreetam requested a review from jpower432 March 31, 2026 08:21
@sonupreetam sonupreetam dismissed marcusburghardt’s stale review March 31, 2026 20:34

The merge-base changed after approval.

Signed-off-by: Sonu Preetam <spreetam@redhat.com>
Signed-off-by: Sonu Preetam <spreetam@redhat.com>
@sonupreetam sonupreetam force-pushed the feat/improve-sync-summary branch from bb906de to df44a1a Compare March 31, 2026 21:21
Copy link
Copy Markdown

@marcusburghardt marcusburghardt left a comment

Choose a reason for hiding this comment

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

LGTM

@sonupreetam sonupreetam requested review from AlexXuan233 and hbraswelrh and removed request for AlexXuan233 April 1, 2026 07:38
return len(r.added) > 0 || len(r.updated) > 0 || len(r.removed) > 0
}

func shortSHA(sha string) string {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sonupreetam this is a completely non-blocking nit, but a potential good "issue" to open for an advancement later / for community mtg. Maybe I could open an issue later with "Make shortSHA length 7 characters to align with Git default SHA format." Wdyt? That could be added to the Community board.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@hbraswelrh Although it is required for a website repo, we can definitely create an issue to align with the format. Thank you!!

Copy link
Copy Markdown
Contributor Author

@sonupreetam sonupreetam Apr 6, 2026

Choose a reason for hiding this comment

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

@hbraswelrh I checked the Git's --abbrev-commit uses 7 as a starting point but grows as needed for uniqueness. There's no canonical "the short SHA is always 7 chars" contract. Also it confers no correctness or usability benefit for the website's use case. So no issue is needed for this, if you did create, let me know we can close it.

}
}

func (r *syncResult) writeUpdatedRepoBlock(b *strings.Builder, name string) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sonupreetam another non-blocking but potential later refinement would be adding another case where oldSHA is empty but newSHA is present with a fallback to "Pinned to." Wdyt as an issue for the Community Board? It's not necessary at the moment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@hbraswelrh Thank you for your review here. The cleanup.go should take care of any orphan files, and there shouldn't be an oldSHA being empty. Will investigate it if this is an issue and will let you know about the community board.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@hbraswelrh For the website's production use case, the fallback is not needed, --lock is always present in both the deploy and check workflows, so oldSHA is always populated for updated repos. It's only the local developer run and --write flag will always take care of it. So no issue is needed for this, if you did create, let me know we can close it.

Copy link
Copy Markdown
Member

@hbraswelrh hbraswelrh left a comment

Choose a reason for hiding this comment

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

LGTM. Left two non-blocking nit comments that could be converted to issues (nit-picky enhancements).

@sonupreetam sonupreetam merged commit f7da599 into complytime:main Apr 1, 2026
12 checks passed
@sonupreetam sonupreetam deleted the feat/improve-sync-summary branch April 1, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants