Skip to content

Conversation

cwillisf
Copy link
Contributor

Resolves:

Supports POD-277

Changes:

Primary change: remove obsolete response objects from Fastly configuration before attempting to update or add any. This helps avoid exceeding the ~100-count limit.

Supporting changes:

  • Type annotations, especially in fastly-extended.js, so I could tell what I was doing.
  • Converted fastly-extended.js into a class so that the type annotations would work.
  • Use Error instances for error reporting in configure-fastly.js, as opposed to using string.
    • Using string was incorrect as it violates the async library's expectations
    • It was also inconsistent: when reporting an error to the async library, we were sometimes passing a string and sometimes passing the output of the fastly library's request call, which uses Error.
  • Reduced log output during redirect preprocessing

Test Coverage:

Existing tests updated

@cwillisf cwillisf requested review from colbygk and Copilot August 26, 2025 17:45
Copy link
Contributor

@Copilot 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 refactors the Fastly configuration code to use proper type annotations and class-based structure, with the primary goal of removing obsolete response objects to avoid Fastly's count limits.

  • Converted fastly-extended.js from function-based to class-based implementation to support type annotations
  • Added proper error handling using Error instances instead of strings for consistency with async library expectations
  • Enhanced Fastly configuration to clean up obsolete response objects before updates

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cwillisf cwillisf changed the title chore: add type annotations in fastly-extended.js Remove obsolete response objects from Fastly configuration Aug 27, 2025
@cwillisf cwillisf marked this pull request as draft August 27, 2025 14:11
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