Skip to content

docs: Convert tutorial markdown code blocks to DocC snippet files#90

Merged
cbaker6 merged 20 commits intomainfrom
copilot/update-docs-parse-server-swift
Feb 3, 2026
Merged

docs: Convert tutorial markdown code blocks to DocC snippet files#90
cbaker6 merged 20 commits intomainfrom
copilot/update-docs-parse-server-swift

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Tutorials contained inline markdown code blocks within @Step directives instead of using DocC's @Code directive with separate snippet files. All code examples should be in dedicated snippet files following DocC best practices.

Changes

Converted all tutorials to use @code snippet files

All four tutorials have been updated to replace inline markdown code blocks with @Code directives referencing snippet files in the Resources directory:

Cloud Code Functions Tutorial

  • Created 15 Swift snippet files for function examples
  • Examples: hello-function-01.swift, query-with-user-credentials.swift, require-authentication.swift, validate-session.swift, client-call-function.swift, response-types-examples.swift, etc.

Cloud Code Triggers Tutorial

  • Created 24 Swift snippet files for trigger examples
  • Examples: trigger-beforesave-01.swift, trigger-beforefind-01.swift, trigger-afterlogin.swift, trigger-livequery-beforeconnect.swift, trigger-check-headers.swift, trigger-types-overview.swift, trigger-bool-return-types.swift, trigger-performance-tips.swift, etc.

Adding ParseObjects Tutorial

  • Created 12 Swift snippet files for model examples
  • Examples: gamescore-with-merge.swift, user-with-relations.swift, profile-with-files.swift, post-with-pointer.swift, parseobject-required-properties.swift, gamescore-many-properties.swift, user-match-schema.swift, shared-package-structure.swift, etc.
  • Fixed corrupted characters in tutorial text

Configuring Parse Server Swift Tutorial

  • Created 13 snippet files with appropriate extensions (.swift, .js, .sh, .txt)
  • Examples: entrypoint-config.swift, parse-server-config.js, start-server.sh, env-config.txt, sdk-manual-config.swift, env-config-explained.txt, configure-function-steps.swift, etc.

Enhanced tutorial clarity

Added code snippets to all informational and explanatory steps that previously only had text:

  • Response type examples showing different ParseHookResponse types
  • Trigger type overviews demonstrating all trigger variants
  • ParseObject required properties with detailed explanations
  • Environment variable configurations with inline documentation
  • Performance best practices with code examples
  • Shared package structure for client-server model sharing

Additional improvements

  • FooParameters.swift and User.swift snippet files added to Resources
  • Removed duplicate inline code where @Code directives already existed
  • Replaced placeholder comments with working code from routes.swift
  • All tutorial steps with instructional content now include corresponding code snippets

Result

  • Total snippet files created: 63
  • No markdown code blocks remain in any @step directive
  • All tutorial steps have aligned code snippets - every instructional step now includes working code examples
  • All code properly referenced via @Code directives following DocC best practices
  • Appropriate file extensions (.swift, .js, .sh, .txt) based on content type
  • Code is now more maintainable and reusable across tutorials
  • Improved tutorial comprehensiveness and clarity with code examples supporting all concepts

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 2, 2026 19:09
Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
…ides

Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
Copilot AI changed the title [WIP] Update tutorial documentation for ParseServerSwift Add comprehensive DocC tutorials and align README examples with routes.swift Feb 2, 2026
Copilot AI requested a review from cbaker6 February 2, 2026 19:20
@cbaker6 cbaker6 marked this pull request as ready for review February 2, 2026 20:47
Copilot AI review requested due to automatic review settings February 2, 2026 20:47
@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

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 adds comprehensive DocC tutorials for Cloud Code implementation and synchronizes README examples with the working code in routes.swift.

Changes:

  • Added two new detailed tutorials: "Cloud Code Functions" and "Cloud Code Triggers" with working examples covering authentication, parameters, error handling, and all trigger types
  • Expanded "Configuration" tutorial to cover both environment variable and programmatic approaches with security best practices
  • Enhanced "ParseObjects" tutorial with relationships, ParseFile integration, and model sharing patterns
  • Updated README code examples to match routes.swift implementation with better formatting and organization

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ParseServerSwift.tutorial Reorganized tutorial structure into "Getting Started" and "Cloud Code" chapters with updated tutorial references
ParseServerSwift.md Added "Additional Resources" section with Parse Swift SDK links and Topics organization
Configuring Parse Server Swift.tutorial Rewrote with comprehensive sections on environment variables, webhookKey security, parseServerSwiftConfigure usage, and programmatic configuration
Cloud Code.tutorial Removed generic Cloud Code tutorial (replaced by specific Functions and Triggers tutorials)
Cloud Code Triggers.tutorial New comprehensive tutorial covering all trigger types with working examples from routes.swift
Cloud Code Functions.tutorial New detailed tutorial on Cloud Functions covering parameters, authentication, primary key queries, and error handling
Adding ParseObjects.tutorial Expanded to include ParseCloudUser vs ParseUser distinction, relationships, ParseFile, and model sharing
README.md Synchronized all code examples with routes.swift, added tutorial links, and organized triggers by type

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

@cbaker6
Copy link
Member

cbaker6 commented Feb 2, 2026

@copilot please reference the tutorial chapters you added in the table of contents

Copilot stopped work on behalf of cbaker6 due to an error February 2, 2026 21:41
@cbaker6
Copy link
Member

cbaker6 commented Feb 2, 2026

@copilot please add code snippets in the tutorial to support the text in the tutorial. You should be able to create example code from https://github.com/netreconlab/parse-server-swift/blob/main/Sources/ParseServerSwift/routes.swift

Also, please remove any irrelevant commented out code you added in the tutorial text, the commented code should be code snippet examples

Copilot AI and others added 2 commits February 3, 2026 00:42
…tutorials

Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
Copilot AI changed the title Add comprehensive DocC tutorials and align README examples with routes.swift Add code snippet files and use actual examples from routes.swift in tutorials Feb 3, 2026
@cbaker6
Copy link
Member

cbaker6 commented Feb 3, 2026

@copilot all markdown code written in a "@step" should be converted to the respective swift, bash, or js code snippet in the tutorial. No markdown code should exist in a step.

Copilot AI and others added 4 commits February 3, 2026 01:33
…nippet files

Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
…ippet files

Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
…ippet files

Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
@code snippet files

Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 3, 2026

@copilot all markdown code written in a "@step" should be converted to the respective swift, bash, or js code snippet in the tutorial. No markdown code should exist in a step.

Done! All markdown code blocks in @step directives have been converted to @code snippet files across all four tutorials:

  • Cloud Code Functions tutorial: 14 code snippets
  • Cloud Code Triggers tutorial: 19 code snippets
  • Adding ParseObjects tutorial: 8 code snippets
  • Configuring Parse Server Swift tutorial: 11 code snippets

The snippet files are properly organized in the Resources directory with appropriate file extensions (.swift, .js, .sh, .txt) and are referenced using @code directives.

Commits: 306de9d, 89f07dd, df32034, 75ada65

Copilot AI changed the title Add code snippet files and use actual examples from routes.swift in tutorials Convert tutorial markdown code blocks to DocC snippet files Feb 3, 2026
@cbaker6 cbaker6 changed the title Convert tutorial markdown code blocks to DocC snippet files docs: Convert tutorial markdown code blocks to DocC snippet files Feb 3, 2026
@cbaker6
Copy link
Member

cbaker6 commented Feb 3, 2026

@copilot please review the tutorial document and make sure all code snippets align with their respective steps. If needed, feel free to add more code snippets or more steps/text to make the tutorial clearer. When adding code snippets, do not add markdown code blocks, instead everything should be a code snippet

Co-authored-by: cbaker6 <8621344+cbaker6@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 3, 2026

@copilot please review the tutorial document and make sure all code snippets align with their respective steps. If needed, feel free to add more code snippets or more steps/text to make the tutorial c...

Completed! I reviewed all four tutorials and added code snippets to every step that was missing them:

Added 11 new code snippet files:

  • response-types-examples.swift - Examples of different ParseHookResponse types
  • trigger-types-overview.swift - Overview of all trigger types
  • trigger-bool-return-types.swift - Triggers that return Bool
  • trigger-file-request-type.swift - File trigger request type explanation
  • trigger-performance-tips.swift - Performance best practices
  • parseobject-required-properties.swift - Required ParseObject properties
  • gamescore-many-properties.swift - Example with many custom properties
  • user-match-schema.swift - User model matching database schema
  • shared-package-structure.swift - Swift Package setup for shared models
  • env-config-explained.swift - Environment variables explained
  • configure-function-steps.swift - parseServerSwiftConfigure automation steps

All code snippets now properly align with their tutorial step descriptions. No markdown code blocks remain in any @step directive.

Commit: 2ea1a81

Copy link

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

Copilot reviewed 78 out of 82 changed files in this pull request and generated 18 comments.


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

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.83%. Comparing base (608b6cb) to head (1c66214).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #90   +/-   ##
=======================================
  Coverage   39.83%   39.83%           
=======================================
  Files          11       11           
  Lines         989      989           
=======================================
  Hits          394      394           
  Misses        595      595           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

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

Copilot reviewed 78 out of 82 changed files in this pull request and generated 16 comments.


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

@@ -0,0 +1,7 @@
guard let object = parseRequest.object else { return }
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

This snippet uses guard ... else { return } but then returns a ParseHookResponse later. If this snippet is meant to live inside a hook/route handler that returns ParseHookResponse, the else branch should also return a ParseHookResponse (typically an error response) to avoid teaching an invalid pattern.

Copilot uses AI. Check for mistakes.
Comment on lines 926 to 930
- parameter parseServerURLStrings: A set of Parse Server `URL`'s to delete triggers for.
Defaults to the set of servers added during configuration.
- throws: An error of `ParseError` type.
- note: WIll attempt to create triggers on all `parseServerURLStrings`.
- note: Will attempt to create triggers on all `parseServerURLStrings`.
Will log an error for each `parseServerURLString` that returns an error.
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The delete API docs’ note says “Will attempt to create triggers…”, but this overload performs a delete (DELETE). Please update the note (and any similar delete overload docs) to say “delete triggers” to match the behavior.

Copilot uses AI. Check for mistakes.
let parseRequest = try req.content
.decode(ParseHookTriggerObjectRequest<User, GameScore>.self)

req.logger.info("A LiveQuery subscription is being made: \(parseRequest)")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The logging call req.logger.info("A LiveQuery subscription is being made: \(parseRequest)") emits the full ParseHookTriggerObjectRequest<User, GameScore> to logs, which is likely to include user authentication data such as a sessionToken. If these logs are compromised, attackers can reuse the tokens to impersonate users or bypass normal access controls. Limit logging to non-sensitive fields (for example, user id, class name, or query parameters) or explicitly redact authentication-related properties from the request before logging.

Copilot uses AI. Check for mistakes.
let parseRequest = try req.content
.decode(ParseHookTriggerObjectRequest<User, GameScore>.self)

req.logger.info("A LiveQuery event occurred: \(parseRequest)")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The line req.logger.info("A LiveQuery event occurred: \(parseRequest)") records the entire ParseHookTriggerObjectRequest<User, GameScore> to logs, including embedded user information that may carry a sessionToken. Storing complete request objects in logs exposes authentication tokens and other sensitive fields to anyone with log access, enabling replay or privilege abuse. Instead, log only essential, non-sensitive attributes (for example, event type and objectId) or build a redacted representation of the request before logging.

Copilot uses AI. Check for mistakes.
let parseRequest = try req.content
.decode(ParseHookTriggerObjectRequest<User, GameScore>.self)

req.logger.info("A query is being made: \(parseRequest)")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The log statement req.logger.info("A query is being made: \(parseRequest)") records the full ParseHookTriggerObjectRequest<User, GameScore> including the embedded User, which typically contains sensitive fields such as sessionToken. Writing this full request object to logs risks leaking authentication tokens, which can be reused by anyone with log access to impersonate users against Parse Server. Instead, log only non-sensitive attributes (for example, the objectId or query parameters) or construct a sanitized representation of the request before logging.

Copilot uses AI. Check for mistakes.
let parseRequest = try req.content
.decode(ParseHookTriggerRequest<User>.self)

req.logger.info("A ParseFile is being saved: \(parseRequest)")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The log statement req.logger.info("A ParseFile is being saved: \(parseRequest)") records the full ParseHookTriggerRequest<User> object, which can include sensitive user information such as sessionToken. If these logs are accessed or leaked, attackers can reuse the tokens to act as the affected users or pivot into other attacks. Only log non-sensitive details (for example, file name or user objectId) or construct a redacted version of the request for logging instead of serializing the whole object.

Copilot uses AI. Check for mistakes.
let parseRequest = try req.content
.decode(ParseHookTriggerRequest<User>.self)

req.logger.info("A ParseFile is being deleted: \(parseRequest)")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The call req.logger.info("A ParseFile is being deleted: \(parseRequest)") logs the complete ParseHookTriggerRequest<User> instance, which may contain sensitive authentication data such as the user’s sessionToken. Logging these values to persistent logs can enable session hijacking by anyone with access to the logging backend. Prefer logging only minimal, non-sensitive fields (for example, file id and user objectId) or explicitly redact authentication-related properties before logging the request.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1 @@
req.logger.info("Trigger executed: \(parseRequest)")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The call to req.logger.info("Trigger executed: \(parseRequest)") logs the entire parseRequest object, which may include sensitive user fields such as sessionToken or other authentication data. If application logs are accessed or exfiltrated, these values can be reused to impersonate users or bypass normal authentication. Limit logging to non-sensitive fields (for example, object identifiers or minimal metadata) or explicitly redact authentication-related properties before logging.

Copilot uses AI. Check for mistakes.
req.logger.info("File uploaded by user: \(user.objectId ?? "unknown")")
}

req.logger.info("A ParseFile is being saved: \(parseRequest)")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The statement req.logger.info("A ParseFile is being saved: \(parseRequest)") logs the entire ParseHookTriggerRequest<User> object, which can include sensitive user data such as a sessionToken. Persisting the full request in logs increases the risk that leaked or over-privileged log access can be turned into account takeover by replaying those tokens. Reduce the log scope to non-sensitive fields (for example, objectId or file metadata) or explicitly scrub authentication-related fields before logging.

Copilot uses AI. Check for mistakes.
let parseRequest = try req.content
.decode(ParseHookTriggerRequest<User>.self)

req.logger.info("A LiveQuery connection is being made: \(parseRequest)")
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The log line req.logger.info("A LiveQuery connection is being made: \(parseRequest)") writes the full ParseHookTriggerRequest<User> to logs, including user details that may contain a sessionToken. Logging these rich request objects makes authentication tokens and other sensitive information available to anyone with log access, enabling replay or impersonation attacks. Log only the minimal, non-sensitive information needed for observability (for example, user objectId or subscription channel) or construct a sanitized version of the request for logging.

Copilot uses AI. Check for mistakes.
Updated the link to the Dockerfile in the README to reflect the latest changes.
@cbaker6 cbaker6 merged commit a88dbfe into main Feb 3, 2026
4 checks passed
@cbaker6 cbaker6 deleted the copilot/update-docs-parse-server-swift branch February 3, 2026 04:55
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