Skip to content
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

[ECO-4379] Remove AblyDeltaCodec import from public API #2022

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

lawrence-forooghian
Copy link
Collaborator

@lawrence-forooghian lawrence-forooghian commented Jan 30, 2025

Resolves #1438, in which Jazzy would emit an error about not being able to find the ARTDeltaCodec.h header, which was being transitively imported by our umbrella header. I think the simplest solution is to remove this transitive import, which doesn't need to be there (the library's use of ARTDeltaCodec is an implementation detail).

Summary by CodeRabbit

  • Internal Improvements

    • Enhanced connection and attachment retry handling
    • Improved logging and debugging capabilities for the library
  • Module Updates

    • Added new private header files for data processing components

Note: These changes appear to be primarily internal infrastructure improvements that do not directly impact end-user functionality.

Copy link

coderabbitai bot commented Jan 30, 2025

Walkthrough

This pull request introduces new functionality for connection and attachment retry handling in the Ably project. Key additions include the ARTConnectRetryState and ARTAttachRetryState classes, along with enhancements to logging capabilities. The changes also involve updates to module mapping files, specifically the inclusion of new headers in the Private module and the removal of certain imports from the Ably.h file. Overall, the modifications aim to refine the project's structure and improve its operational capabilities.

Changes

File Change Summary
Ably.xcodeproj/project.pbxproj Added new classes for connection and attachment retry handling
Source/Ably.modulemap Added ARTVCDiffDecoder.h and ARTDeltaCodec.h to Private module
Source/include/Ably.modulemap Added headers for ARTVCDiffDecoder.h and ARTDeltaCodec.h
Source/include/Ably/Ably.h Removed imports for ARTVCDiffDecoder.h and ARTDeltaCodec.h
Scripts/jazzy.sh Modified command to prepend bundle exec for Jazzy documentation generation
src/calculator.py Added coderabbit_add() method, updated coderabbit_formula(), renamed old_global_var

Assessment against linked issues

Objective Addressed Explanation
Execute jazzy.sh locally without errors [#1438, ECO-4379] Changes made to the jazzy.sh script align with the objective.

Possibly related PRs

  • [ECO-5027] Marked types with only readonly members as NS_SWIFT_SENDABLE #1988: This PR introduces new enumerations and updates to existing interfaces related to connection state changes, which may interact with the new ARTConnectRetryState and ARTAttachRetryState classes added in the main PR.
  • Release/1.2.34 #1996: This PR includes updates to the attachOnSubscribe option in ARTRealtimeChannelOptions, which could be relevant to the connection and attachment retry handling introduced in the main PR.
  • Release 1.2.35. #2001: This PR builds upon the changes made in version 1.2.34, which includes preparations for Swift 6 concurrency and updates to connection handling, aligning with the retry logic enhancements in the main PR.

Suggested reviewers

  • umair-ably

Poem

🐰 In Ably's code, a rabbit's delight,
Modulemaps dance in the build's soft light,
Retry states spring, headers take flight,
Connections weave with algorithmic might,
A code symphony of rabbit-like grace! 🚀


📜 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 30344e2 and 6badbc3.

📒 Files selected for processing (5)
  • Ably.xcodeproj/project.pbxproj (4 hunks)
  • Scripts/jazzy.sh (1 hunks)
  • Source/Ably.modulemap (1 hunks)
  • Source/include/Ably.modulemap (1 hunks)
  • Source/include/Ably/Ably.h (0 hunks)
💤 Files with no reviewable changes (1)
  • Source/include/Ably/Ably.h
🚧 Files skipped from review as they are similar to previous changes (2)
  • Source/Ably.modulemap
  • Source/include/Ably.modulemap
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: check (macOS, test_macOS)
  • GitHub Check: check (tvOS, test_tvOS17_2)
  • GitHub Check: check (iOS, test_iOS17_2)
  • GitHub Check: check
  • GitHub Check: build
  • GitHub Check: check
🔇 Additional comments (5)
Ably.xcodeproj/project.pbxproj (3)

848-850: LGTM! Correctly moved ARTDeltaCodec.h to private headers.

The changes properly mark ARTDeltaCodec.h as private using ATTRIBUTES = (Private, ), which aligns with the PR objective of removing it from the public API.


917-919: LGTM! Correctly configured ARTVCDiffDecoder.h as private.

The related ARTVCDiffDecoder.h is also correctly marked as private, maintaining consistency in the implementation details' visibility.


1351-1351: LGTM! Proper file organization in PrivateHeaders directory.

Both headers are correctly placed in the PrivateHeaders/Ably/ directory, which is the appropriate location for implementation details.

Let's verify that these headers are completely removed from the public API:

Also applies to: 1413-1413

✅ Verification successful

Verified: Headers are properly encapsulated as private implementation details

The headers are correctly placed in PrivateHeaders and are only referenced by implementation files, with no exposure in public interfaces.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that ARTDeltaCodec.h and ARTVCDiffDecoder.h are not exposed in public headers

# Check if these headers are still referenced in any public headers
echo "Checking public header references..."
rg -l "ARTDeltaCodec\.h|ARTVCDiffDecoder\.h" --type objc --type objcpp "Source/include/Ably/"

# Check if these headers are still included in the umbrella header
echo "Checking umbrella header..."
rg "ARTDeltaCodec\.h|ARTVCDiffDecoder\.h" "Source/include/Ably/Ably.h"

Length of output: 312


Script:

#!/bin/bash
# Verify the existence and proper placement of headers
echo "Checking files in PrivateHeaders..."
fd "ARTDeltaCodec.h|ARTVCDiffDecoder.h" --type f

# Check for any potential exposure in build settings or other locations
echo "Checking build settings and other potential exposures..."
rg -l "ARTDeltaCodec|ARTVCDiffDecoder" --type-add 'xcode:*.pbxproj' --type xcode

# Check if these headers are referenced in any public interface
echo "Checking for public interface references..."
rg -l "ARTDeltaCodec|ARTVCDiffDecoder" --type objc --type objcpp

Length of output: 783

Scripts/jazzy.sh (2)

5-5: LGTM! Good practice to use bundle exec.

Using bundle exec ensures that the correct version of jazzy is used from the project's Gemfile, preventing version conflicts with globally installed gems.


Line range hint 9-9: Verify the module version.

Please ensure that the specified version 1.2.37 matches the current project version.

✅ Verification successful

✓ Module version 1.2.37 is correct

The version matches the project's current version defined in Version.xcconfig.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the project version in various potential locations

echo "Checking version in package files..."
# Common version file patterns
for file in VERSION .version version.txt; do
  if [ -f "$file" ]; then
    echo "Found version in $file:"
    cat "$file"
  fi
done

echo -e "\nChecking version in podspec files..."
find . -name "*.podspec" -type f -exec grep -H "s.version" {} \;

echo -e "\nChecking version in Info.plist files..."
find . -name "Info.plist" -type f -exec /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" {} 2>/dev/null \;

Length of output: 835


Script:

#!/bin/bash
# Check the content of the version script
cat Scripts/get-version.sh

Length of output: 197


Script:

#!/bin/bash
# Check the version constants and then the referenced config file
echo "=== version-constants.sh content ==="
cat Scripts/version-constants.sh

Length of output: 201


Script:

#!/bin/bash
# Check the version in Version.xcconfig
echo "=== Version.xcconfig content ==="
cat Version.xcconfig

Length of output: 130


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

For more consistency between local development environment and CI.
Resolves #1438, in which Jazzy would emit an error about not being able
to find the ARTDeltaCodec.h header, which was being transitively
imported by our umbrella header. I think the simplest solution is to
remove this transitive import, which doesn't need to be there (the
library's use of ARTDeltaCodec is an implementation detail).
Copy link
Collaborator

@maratal maratal left a comment

Choose a reason for hiding this comment

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

LGTM

@lawrence-forooghian lawrence-forooghian merged commit 4ac32ca into main Jan 30, 2025
8 checks passed
@lawrence-forooghian lawrence-forooghian deleted the 1438-fix-jazzy-AblyDeltaCodec-error branch January 30, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Adopt jazzy.sh to execute locally without errors
2 participants