Skip to content

Conversation

Evesy
Copy link
Contributor

@Evesy Evesy commented Jun 24, 2025

Affected Components

  • New Features
  • Bug Fixing
  • Types
  • Tests
  • Docs
  • Other

Style

  • Go code is formatted with go fmt

Notes for the Reviewer

FIxes json: cannot unmarshal array into Go value of type string currently observed in the GetStaticIPs method.

/v1/static-ipv6s-by-region was historically a map with string values but was changed at some point to be a string array; this updates the go client to reflect that change.

If a corresponding Terraform provider version could be published on the back of this that would be great, as that's where we're personally impacted by the issue

Copy link

coderabbitai bot commented Jun 24, 2025

Walkthrough

The changes update the handling of IPv6 static IPs in the codebase and its associated test fixture. The code now expects each region to provide a list of IPv6 CIDR strings, rather than a single string per region. The fixture JSON structure is updated to match this new format.

Changes

Files Change Summary
checkly.go Modified GetStaticIPs to unmarshal IPv6 static IPs as a map of region to list of CIDR strings, iterating over each.
fixtures/StaticIPv6s.json Changed JSON structure: each region now maps to an array of IPv6 CIDR strings instead of a single string.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9431512 and 68a459a.

📒 Files selected for processing (2)
  • checkly.go (1 hunks)
  • fixtures/StaticIPv6s.json (1 hunks)
🔇 Additional comments (3)
fixtures/StaticIPv6s.json (1)

1-1: LGTM! Fixture correctly updated to match new API structure.

The JSON structure properly reflects the API change from single IPv6 CIDR strings to arrays of CIDR strings per region. This ensures the test fixture remains consistent with the updated GetStaticIPs method implementation.

checkly.go (2)

1683-1684: LGTM! Correct type change to handle API response format.

The variable declaration is properly updated from map[string]string to map[string][]string to match the new API response structure where each region maps to an array of IPv6 CIDR strings instead of a single string.


1690-1699: LGTM! Proper iteration logic for handling IP arrays.

The nested loop correctly handles the new data structure:

  • Outer loop iterates over regions and their corresponding IP arrays
  • Inner loop processes each individual IP string within the array
  • Error handling and IP parsing logic remain consistent
  • Variable naming is clear (ips for the array, ip for individual strings)

This change makes the IPv6 handling consistent with the existing IPv4 logic (lines 1721-1729) which already used the same pattern.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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 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.

@sorccu
Copy link
Member

sorccu commented Jun 24, 2025

Thanks, I'll look at this shortly 👍

@sorccu sorccu self-assigned this Jun 24, 2025
@sorccu
Copy link
Member

sorccu commented Jun 24, 2025

It looks like this broke around June 16th. The new format is more correct than the old one, but it was definitely a breaking change.

@sorccu sorccu self-requested a review June 24, 2025 18:40
@sorccu sorccu merged commit ff0eea9 into checkly:main Jun 24, 2025
1 check passed
@sorccu
Copy link
Member

sorccu commented Jun 24, 2025

This should be available shortly in TF provider v1.11.1 which is being released right now.

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