Skip to content

Add Atlassian Rovo Dev provider#676

Open
Rahulsharma0810 wants to merge 1 commit intosteipete:mainfrom
Rahulsharma0810:add-rovodev-provider
Open

Add Atlassian Rovo Dev provider#676
Rahulsharma0810 wants to merge 1 commit intosteipete:mainfrom
Rahulsharma0810:add-rovodev-provider

Conversation

@Rahulsharma0810
Copy link
Copy Markdown

Summary

  • Add .rovodev provider tracking Atlassian Rovo Dev monthly credit usage via a silent Web-API background fetcher (no CLI dependency, same pattern as Ollama)
  • Site URL and cloud ID resolved at runtime from ~/.config/acli/global_auth_config.yaml — zero manual config needed for ACLI users
  • Browser cookies imported automatically via SweetCookieKit (Chrome/Safari/Firefox); manual cookie paste also supported
  • Status page link opens the Rovo Dev usage page instead of the generic Atlassian status page
  • Fix MenuHighlightStyle.swift @Entry macro so the project builds with swift build CLI (SwiftUIMacros plugin requires the full Xcode toolchain)

API

POST https://{site}/gateway/api/rovodev/v3/credits/entitlements/entitlement-allowance
Body: { "cloudId": "…", "entitlementId": "unknown", "productKey": "unknown" }

Response:
{
  "currentUsage": 0,
  "creditCap": 6000,
  "nextRefresh": 1746572177000,
  "effectiveEntitlement": "ROVO_DEV_STANDARD_TRIAL"
}

New files

File Purpose
CodexBarCore/Providers/RovoDev/RovoDevUsageSnapshot.swift Data model; converts to UsageSnapshot
CodexBarCore/Providers/RovoDev/RovoDevUsageFetcher.swift ACLI config reader, cookie importer, API fetcher
CodexBarCore/Providers/RovoDev/RovoDevProviderDescriptor.swift Metadata + RovoDevWebFetchStrategy
CodexBar/Providers/RovoDev/RovoDevSettingsStore.swift Cookie source / manual header settings
CodexBar/Providers/RovoDev/RovoDevProviderImplementation.swift Settings UI, cookie picker
CodexBar/Resources/ProviderIcon-rovodev.svg Atlassian-branded diamond icon

Shared wiring

Providers.swift · ProviderSettingsSnapshot · ProviderDescriptor · ProviderImplementationRegistry · LogCategories · CostUsageScanner · TokenAccountCLI · UsageStore · CodexBarWidgetProvider · CodexBarWidgetViews

Validation

Adds a new `.rovodev` provider that tracks Atlassian Rovo Dev monthly
credit usage via a silent Web-API based background fetcher — no CLI
dependency, same pattern as the Ollama extension.

## What's included

**New provider files**
- `RovoDevUsageSnapshot` — data model: `currentUsage`, `creditCap`,
  `nextRefresh`, `effectiveEntitlement`; converts to `UsageSnapshot`
  with `usedPercent = currentUsage / creditCap * 100`
- `RovoDevACLIConfig` — reads `~/.config/acli/global_auth_config.yaml`
  at runtime to resolve the active Atlassian site and cloud ID
- `RovoDevUsageFetcher` — POSTs to
  `https://{site}/gateway/api/rovodev/v3/credits/entitlements/entitlement-allowance`
  authenticated via browser cookies imported with `SweetCookieKit`
- `RovoDevProviderDescriptor` — metadata, fetch strategy, status link
  points to the Rovo Dev usage page (not the generic status page)
- `RovoDevSettingsStore` — cookie source (auto/manual) and manual
  cookie header settings
- `RovoDevProviderImplementation` — settings UI, cookie picker,
  "Open Rovo Dev Usage" link action
- `ProviderIcon-rovodev.svg` — Atlassian-branded diamond icon

**Shared wiring**
- `Providers.swift` — `.rovodev` added to `UsageProvider` and `IconStyle`
- `ProviderSettingsSnapshot` — `RovoDevProviderSettings` struct + full
  builder chain
- `ProviderDescriptor` — descriptor registered
- `ProviderImplementationRegistry` — implementation registered
- `LogCategories` — `rovodev` log category
- `CostUsageScanner` — exhaustive switch updated
- `TokenAccountCLI` — `.rovodev` case + snapshot wiring
- `UsageStore` — `.rovodev` debug probe
- `CodexBarWidgetProvider` / `CodexBarWidgetViews` — widget stubs

**Build fix**
- `MenuHighlightStyle.swift` — manually expanded `@Entry` macro so the
  project builds with `swift build` CLI (SwiftUIMacros plugin is only
  available inside the full Xcode toolchain)

## Validation
- `./Scripts/compile_and_run.sh`
- Verified live: app shows "0% used · ROVO_DEV_STANDARD_TRIAL · Resets
  May 7, 2026" matching https://outreach-io.atlassian.net/rovodev/your-usage
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: 44e27245b4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

matching: query, in: browser, logger: log)
for source in sources where !source.records.isEmpty {
let cookies = BrowserCookieClient.makeHTTPCookies(source.records, origin: query.origin)
allCookies.append(contentsOf: cookies)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Select one browser cookie source instead of concatenating all

importSession appends every cookie from every detected browser/profile into a single Cookie header, which can mix different Atlassian sessions and duplicate cookie names. In environments where users are signed into different Atlassian accounts across browsers, the request can authenticate as the wrong account or fail intermittently because conflicting cookie values are sent together. Prefer selecting one validated session source (as other importers do) rather than aggregating all cookies.

Useful? React with 👍 / 👎.

Comment on lines +75 to +79
site = Self.value(after: "site:", in: trimmed)
} else if trimmed.hasPrefix("cloud_id:") {
cloudID = Self.value(after: "cloud_id:", in: trimmed)
}
if site != nil, cloudID != nil { break }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Parse site/cloud_id from the same YAML profile block

This parser takes the first site: and first cloud_id: seen anywhere in the file and stops, without enforcing that both values came from the same YAML object. If global_auth_config.yaml contains multiple profiles, it can pair a site from one profile with a cloud ID from another, causing requests to hit the wrong tenant and consistently fail. The parser needs to respect YAML structure when extracting the active profile.

Useful? React with 👍 / 👎.

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.

1 participant