8000 feat(imports): make and revoke import webhooks on the namespace page by adeelahmad · Pull Request #187 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(imports): make and revoke import webhooks on the namespace page - #187

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-09gtp0
Oct 5, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-09gtp0

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: import webhooks (#155) existed only in the API, so making a token meant calling it by hand.

After: a namespace's page (Admin → Namespaces → a namespace) has an Import webhooks section for owners. "New webhook" asks for a name and then shows the push address, the token (once) and copy-ready curl examples for a file and a link. Each hook row shows its token's last four characters and how much it imported, with Pause/Resume, New token and Delete. Non-owners see the section with the button disabled and the reason.

How: components/imports/import-hooks.tsx, using the generated ImportHooks client; one line on the namespace page.

Motivation and Context

Per-namespace tokens that can be created and revoked in the web UI, as asked for alongside the import webhook.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (eslint, prettier, tsc clean).
  • I added or updated tests (__tests__/import-hooks.test.tsx).
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_012n4GFU7rnEd6r6S44JXnYa


Generated by Claude Code

Owners get an "Import webhooks" section: make one (its token and ready-to-run
curl examples shown once), pause or resume it, give it a new token, or delete
it. Each row shows the token's last four characters and what it imported.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012n4GFU7rnEd6r6S44JXnYa
@adeelahmad adeelahmad self-assigned this Oct 5, 2026
Copy link
Copy Markdown
Owner Author

FastAPI (embedded SurrealDB) failed on tests/api/test_sensors.py::test_syslog_senders_become_sensors (KeyError: 'port'). The failure isn't from this PR, which changes only web app files.

Cause: with syslog_port=0, syslog.Listener binds UDP to a random port and then binds TCP to the same number. On a busy runner running tests in parallel, that TCP port can already be taken. The OSError leaves the hub's state["syslog"] without a port, which is the key the test reads. It passes locally 3 times out of 3. No fix PR exists yet. A minimal fix would be to retry with a fresh random port when the port asked for is 0:

# app/domain/syslog.py, Listener.__init__
for attempt in range(5 if port == 0 else 1):
    self.udp = UdpServer((host, port), Udp)
    self.port = self.udp.server_address[1]
    try:
        self.tcp = TcpServer((host, self.port), Tcp) if tcp else None
        break
    except OSError:
        self.udp.server_close()
        if attempt == 4 or port != 0:
            raise

I've re-run the failed job once.


Generated by Claude Code

@adeelahmad
adeelahmad merged commit fd20873 into main Oct 5, 2026
7 of 8 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-09gtp0 branch October 5, 2026 13:04
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.

2 participants

0