Skip to content

Conversation

@freeznet
Copy link
Member

@freeznet freeznet commented Jan 2, 2026

(If this PR fixes a github issue, please add Fixes #<xyz>.)

Fixes #364

(or if this PR is one task of a github issue, please add Master Issue: #<xyz> to link to the master issue.)

Master Issue: #

Motivation

Explain here the context, and why you're making that change. What is the problem you're trying to solve.

Modifications

Describe the modifications you've done.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@freeznet freeznet requested a review from Copilot January 2, 2026 15:48
@freeznet freeznet self-assigned this Jan 2, 2026
@freeznet freeznet requested review from a team as code owners January 2, 2026 15:48
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

@freeznet:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@github-actions github-actions bot added the doc-info-missing This pr needs to mark a document option in description label Jan 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the server field optional in the StreamNativeCloudConnection API with a default value of https://api.streamnative.cloud, addressing issue #364. The change simplifies configuration for users who are connecting to the default StreamNative Cloud API server.

Key Changes:

  • Made the server field optional with a default value in the StreamNativeCloudConnection CRD
  • Added a GetServer() method to encapsulate the default value logic
  • Updated api_connection.go to use the new GetServer() method
  • Updated copyright years across CRD files from 2025 to 2026

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
api/v1alpha1/streamnativecloudconnection_types.go Added GetServer() method and made Server field optional with default value
pkg/streamnativecloud/api_connection.go Updated to use GetServer() instead of direct Server field access
config/crd/bases/resource.streamnative.io_streamnativecloudconnections.yaml Added default value and removed server from required fields in CRD
charts/pulsar-resources-operator/crds/resource.streamnative.io_streamnativecloudconnections.yaml Mirrored CRD changes for Helm chart
config/crd/bases/resource.streamnative.io_*.yaml (17 files) Updated copyright year to 2026
charts/pulsar-resources-operator/crds/resource.streamnative.io_*.yaml (17 files) Updated copyright year to 2026

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,4 +1,4 @@
# Copyright 2025 StreamNative
# Copyright 2026 StreamNative
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The copyright year has been updated to 2026, but we are currently in January 2026. This is likely premature - copyright years typically reflect when the code was created or last significantly modified. Unless this is part of a coordinated repository-wide update, this should remain as 2025.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

@freeznet we should keep the Copyright year unchanged

Comment on lines +49 to +55
// GetServer returns the server URL, using the default if not specified
func (s *StreamNativeCloudConnectionSpec) GetServer() string {
if s.Server == "" {
return DefaultStreamNativeCloudServer
}
return s.Server
}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The GetServer method implements default value logic that should be tested. Consider adding unit tests to verify that:

  1. GetServer returns the default URL when Server is empty
  2. GetServer returns the specified Server when it is set
    This will ensure the default value functionality works correctly.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-info-missing This pr needs to mark a document option in description

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make StreamNativeCloudConnection server as optional and with default value

3 participants