Skip to content

⬆️ Update bitbucket schema and openapi-typescript #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

NatoBoram
Copy link
Collaborator

@NatoBoram NatoBoram commented Jun 4, 2025

Summary by CodeRabbit

  • New Features

    • Added support for a default branch deletion setting in branching model configurations, allowing branches to be deleted automatically upon merge.
    • Introduced a new indicator showing whether a pull request is queued.
  • Dependency Updates

    • Upgraded "openapi-fetch" and "openapi-typescript" packages to newer versions.
  • Chores

    • Updated dependency management and release workflows for improved automation and reliability.
    • Removed an obsolete workflow for patch version automation.

@NatoBoram NatoBoram self-assigned this Jun 4, 2025
Copy link

coderabbitai bot commented Jun 4, 2025

📝 Walkthrough

Walkthrough

This update introduces the default_branch_deletion property to branching model settings in both the OpenAPI specification and TypeScript types, reflecting whether branches are deleted by default upon merge. The pull request schema also gains a queued boolean property. Several workflow files are updated or removed, and dependencies related to OpenAPI are upgraded.

Changes

File(s) Change Summary
.github/dependabot.yaml Added a new dependency group "openapi" for npm packages matching "openapi".
.github/workflows/node.js.yaml Simplified commit push step by removing SSH agent/key setup; push now runs directly.
.github/workflows/pnpm-publish.yaml Changed release asset upload to use gh release create with environment variable for tag.
.github/workflows/pnpm-version-patch.yaml Deleted workflow automating patch versioning, release, and publishing.
package.json Updated "openapi-fetch" and "openapi-typescript" dependency versions.
src/cloud/openapi/openapi-typescript.ts
src/cloud/openapi/swagger.v3.json
Added default_branch_deletion property to branching model settings and queued to pullrequest schema.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API
    participant RepoSettings

    Client->>API: GET /repositories/{workspace}/{repo_slug}/branching-model/settings
    API->>RepoSettings: Retrieve settings
    RepoSettings-->>API: Return settings (incl. default_branch_deletion)
    API-->>Client: Respond with settings

    Client->>API: PUT /repositories/{workspace}/{repo_slug}/branching-model/settings (with default_branch_deletion)
    API->>RepoSettings: Update settings (set default_branch_deletion)
    RepoSettings-->>API: Confirmation
    API-->>Client: Respond with updated settings

    Client->>API: GET /pullrequest
    API-->>Client: Respond with pullrequest (incl. queued property)
Loading

Suggested labels

dependencies, enhancement, javascript, documentation

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch feature/update-bitbucket
  • Post Copyable Unit Tests in Comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@NatoBoram NatoBoram force-pushed the feature/update-bitbucket branch from 7c03fc1 to cbebb44 Compare June 4, 2025 20:55
@NatoBoram NatoBoram marked this pull request as ready for review June 4, 2025 20:56
@NatoBoram NatoBoram requested a review from a team as a code owner June 4, 2025 20:56
@NatoBoram NatoBoram requested review from sleep-404 and nehal-a2z and removed request for a team June 4, 2025 20:56
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (8)
.github/workflows/pnpm-publish.yaml (2)

48-48: Use explicit asset path and ensure idempotent release creation
Relying on coderabbitai-bitbucket-*.tgz can accidentally match multiple files or miss the tarball if the working directory shifts. Prefer an explicit relative path, for example:

- gh release create "$VERSION" --generate-notes --title "$VERSION" --verify-tag coderabbitai-bitbucket-*.tgz
+ gh release create "$VERSION" --generate-notes --title "$VERSION" --verify-tag ./coderabbitai-bitbucket-${VERSION}.tgz

Also note that gh release create will fail if the release already exists. To make this step idempotent, you can add --replace (or use gh release upload --clobber on an existing release).


51-51: Promote VERSION to job-level env for broader reuse
Defining VERSION under this step’s env limits its scope to only this run. If you ever need the tag in other steps (or in a matrix), move it under jobs.publish.env::

jobs:
  publish:
    runs-on: ubuntu-latest
    env:
      VERSION: ${{ github.ref_name }}
    steps:
      #

This ensures consistency across all steps.

package.json (2)

53-53: Verify lockfile regeneration after dependency bump.

Please ensure pnpm install was run and the updated lockfile (e.g., pnpm-lock.yaml or package-lock.json) has been committed to avoid CI inconsistencies.


64-64: Ensure devDependencies lockfile consistency.

After upgrading openapi-typescript, confirm that the lockfile reflects the new version and was checked into version control.

src/cloud/openapi/openapi-typescript.ts (1)

1694-1698: Consider the design choice of string boolean values.

The documentation is clear, but using string values "true" and "false" instead of actual boolean types is unusual and potentially error-prone. This design choice may lead to:

  1. Type safety issues where developers might accidentally pass actual booleans
  2. Runtime confusion when handling the values
  3. Additional string parsing logic required

If this design is constrained by the OpenAPI specification, consider adding a note in the documentation to clarify why strings are used instead of booleans.

src/cloud/openapi/swagger.v3.json (3)

1652-1652: Clarify enumeration of default_branch_deletion in GET description

The GET description adds default_branch_deletion but omits its type and valid values. Consider stating that it’s a string with "true" or "false" to match the PUT endpoint.


1763-1763: Enhance clarity on handling invalid default_branch_deletion values

The PUT docs state that other values are ignored. To aid API consumers, consider elaborating whether invalid values are silently dropped or trigger a specific response.


23063-23063: Align project GET description with repository GET

The project GET description mirrors the repository description but uses a different link style. For consistency, match the URL formatting and detail level between both endpoints.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 945ab3b and cbebb44.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .github/dependabot.yaml (1 hunks)
  • .github/workflows/node.js.yaml (1 hunks)
  • .github/workflows/pnpm-publish.yaml (1 hunks)
  • .github/workflows/pnpm-version-patch.yaml (0 hunks)
  • package.json (2 hunks)
  • src/cloud/openapi/openapi-typescript.ts (5 hunks)
  • src/cloud/openapi/swagger.v3.json (10 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/pnpm-version-patch.yaml
🔇 Additional comments (12)
.github/workflows/node.js.yaml (1)

119-120: Add conditional push to the fix job

The new if guard correctly ensures git push only runs when lockfile, format, or lint commits have been created. The syntax and logic look sound.

.github/dependabot.yaml (1)

22-24: Approve the new "openapi" dependency group.

Adding a dedicated group for dependencies matching *openapi* will help streamline maintenance of your OpenAPI-related packages.

src/cloud/openapi/openapi-typescript.ts (4)

1592-1593: LGTM! Clear documentation added.

The documentation clearly explains the purpose of the default_branch_deletion property.


17692-17693: LGTM! Consistent documentation across endpoints.

The documentation is consistent with the repository-level endpoint, maintaining good API documentation standards.


17784-17788: Consistent documentation maintained across API levels.

The documentation is identical to the repository-level endpoint, which maintains good consistency. The same consideration about string boolean values mentioned in the repository-level endpoint applies here as well.


22246-22247: LGTM! Well-implemented boolean property.

The queued property is properly typed as a boolean with clear documentation. Good design choice using an actual boolean type rather than string values.

src/cloud/openapi/swagger.v3.json (6)

1703-1704: Verify type consistency for default_branch_deletion in GET response example

The example uses "default_branch_deletion": "false" (a string). Ensure the schema defines this property as a string. If the intent is a JSON boolean, update the example and schema accordingly.


1803-1804: Confirm type definition in PUT response example

The PUT response shows "default_branch_deletion": "true" as a string. Double-check that the properties schema for this response declares it as a string.


23112-23113: Verify schema inclusion of default_branch_deletion in project GET response

The example shows default_branch_deletion. Please confirm the shared schema definitions for projects include this property under properties with the correct type and description.


23172-23172: default_branch_deletion docs in project PUT look correct

The default_branch_deletion documentation aligns with the repository endpoint. This section clearly describes behaviour and valid values.


23212-23213: default_branch_deletion example in project PUT response is correct

The example response includes "default_branch_deletion": "false" as expected. No issues found here.


25136-25136: Sync x-revision across generated artifacts

The OpenAPI spec’s x-revision has been bumped. Ensure that the generated TypeScript client and any other artifacts reference this same revision to prevent mismatches.

@NatoBoram NatoBoram merged commit 097e842 into main Jun 4, 2025
3 checks passed
@NatoBoram NatoBoram deleted the feature/update-bitbucket branch June 4, 2025 21:06
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