Skip to content

feat: add Confluence auto-collector as new data source - #106

Open
leecoder wants to merge 1 commit into
titanwings:mainfrom
leecoder:feat/confluence-auto-collector
Open

feat: add Confluence auto-collector as new data source#106
leecoder wants to merge 1 commit into
titanwings:mainfrom
leecoder:feat/confluence-auto-collector

Conversation

@leecoder

Copy link
Copy Markdown

Summary

Add Confluence Cloud and Server/Data Center support as a new data source for collecting colleague knowledge (pages, comments).

Changes

New file

  • tools/confluence_auto_collector.py — Confluence auto-collector
    • Cloud auth (email + API Token) and Server auth (PAT / Basic)
    • User search via /rest/api/search/user with accountId for CQL (Cloud)
    • Page collection (creator + contributor) with optional space filtering
    • Comment collection with long/short classification
    • Rate-limit retry, HTML-to-text conversion, unified output format
    • CLI with --setup, --name, --output-dir, --doc-limit, --comment-limit, --space-key

Modified files

  • SKILL.md — Add Option B2 (Confluence) in both CN and EN versions, tool table, detailed usage
  • README.md — Add Confluence to data source table, project structure, dependency note
  • INSTALL.md — Add Confluence Cloud/Server setup guide, usage examples, troubleshooting
  • requirements.txt — Note requests is also used by Confluence collector

Testing

Verified against live Confluence Cloud instance (tmobi.atlassian.net):

  • User search: Korean display name → accountId mapping
  • Page collection: 3 pages with space filter (AIAGENTPJT)
  • Comment collection: 5 comments with long/short classification
  • Output files: docs.txt, messages.txt, collection_summary.json
  • Unit tests: html_to_text, format_docs, format_comments, ConfClient auth (3 modes), error handling

Add Confluence Cloud and Server/Data Center support for collecting
colleague data (pages, comments) via REST API with CQL search.

- New tool: tools/confluence_auto_collector.py
  - Cloud auth (email + API Token) and Server auth (PAT / Basic)
  - User search via /rest/api/search/user with accountId for CQL
  - Page collection (creator + contributor) with space filtering
  - Comment collection with long/short classification
  - Rate-limit retry, HTML-to-text conversion, unified output format
- SKILL.md: add Option B2 (Confluence) in both CN and EN versions
- README.md: add Confluence to data source table and project structure
- INSTALL.md: add Confluence setup guide and troubleshooting
- requirements.txt: note requests is also used by Confluence collector
titanwings added a commit that referenced this pull request Apr 15, 2026
Set up the community-facing infrastructure a maintained OSS project needs:

- GitHub Actions CI: py_compile on tools/, unittest discover (no-op until
  tests/ exists), and a non-blocking ruff lint job. Runs on push to main
  and on pull_request, matrix over Python 3.9 and 3.11.
- Pull request template with bilingual EN/CN prompts, a testing checklist,
  and a security reminder about secrets.
- Issue templates for bug, feature, and question, plus a config.yml that
  disables blank issues and links to Discord and the skill gallery.
- CONTRIBUTING.md covering branch naming, commit style (Conventional
  Commits), dev setup, test expectations, security rules (no secrets,
  0600 perms on credential files), and docs/i18n expectations.

This is prep work so future PRs (e.g. #106 Confluence collector) can be
reviewed against a consistent bar.
titanwings added a commit that referenced this pull request Apr 15, 2026
Set up the community-facing infrastructure a maintained OSS project needs:

- GitHub Actions CI: py_compile on tools/, unittest discover (no-op until
  tests/ exists), and a non-blocking ruff lint job. Runs on push to main
  and on pull_request, matrix over Python 3.9 and 3.11.
- Pull request template with bilingual EN/CN prompts, a testing checklist,
  and a security reminder about secrets.
- Issue templates for bug, feature, and question, plus a config.yml that
  disables blank issues and links to Discord and the skill gallery.
- CONTRIBUTING.md covering branch naming, commit style (Conventional
  Commits), dev setup, test expectations, security rules (no secrets,
  0600 perms on credential files), and docs/i18n expectations.

This is prep work so future PRs (e.g. #106 Confluence collector) can be
reviewed against a consistent bar.
@titanwings

Copy link
Copy Markdown
Owner

Thanks for the contribution @leecoder — code is well-structured, retry/pagination is solid, and all 3 auth modes look correct.

Two things before merge:

1. Add the test files. The PR description mentions unit tests but they're not in the diff. Please commit them under tests/test_confluence_collector.py:

  • stdlib unittest only
  • mock HTTP with unittest.mock — do not hit live Confluence
  • cover at minimum: html_to_text, format_docs / format_comments, and ConfClient._request on 200 / 401 / 403 / 429 / 404

See CONTRIBUTING.md. CI now runs tests automatically on push.

2. Bug at tools/confluence_auto_collector.py:351:

u = data2["results"][0].get("u", {})   # typo — should be "user"

Compare line 313. This breaks the Cloud email-fallback path in find_user.

Once those are in, happy to merge. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data-source New or modified data source collector needs-tests PR lacks tests or test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants