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

Localhost link lint #16424

Merged
merged 13 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/styles/cloudflare/LinkChecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Warning: cloudflare.MeaningfulLinkWords
#
# Checks for the presence of semantically unhelpful words in link text.
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "**Warning**: When referring to another page in our docs, use the full relative link (`/1.1.1.1/check/`) instead of the full URL (`https://developers.cloudflare.com/1.1.1.1/check/`) or a local development link (`http://localhost:1111`)."
level: warning
ignorecase: true
scope: raw
nonword: true
tokens:
- \[.*\]\(https?:\/\/developers\.cloudflare\.com\/.+\)
- \[.*\]\(https?:\/\/localhost:1111\/.*?\)
1 change: 0 additions & 1 deletion .github/styles/cloudflare/MeaningfulLinkWords.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ tokens:
- \[here\]\(.*\)
- \[this page\]\(.*\)
- \[read more\]\(.*\)

5 changes: 4 additions & 1 deletion .github/styles/cloudflare/RelativeLinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
#
# For a list of all options, see https://vale.sh/docs/topics/styles/
extends: existence
message: "**Warning**: When referring to another page in our docs, use the full relative link (`/1.1.1.1/check/`) instead of the full URL (`https://developers.cloudflare.com/1.1.1.1/check/`)."
message: "**Warning**: When referring to another page in our docs, use the full relative link (`/1.1.1.1/check/`) instead of the full URL (`https://developers.cloudflare.com/1.1.1.1/check/`) or a local development link (`http://localhost:1111`)."
level: warning
scope: raw
raw:
- '\[.+\]\(https?:\/\/developers\.cloudflare\.com\/.+\)'
- '\[.+\]\(https?:\/\/github\.cloudflare\.com\/.+\)'
- '\[.*?\]\(http:\/\/localhost:1111\/.*?\)'
- '\[[^\]]+\]\(https?:\/\/developers\.cloudflare\.com\/.*?\)'
37 changes: 37 additions & 0 deletions .github/workflows/vale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Style guide
on:
pull_request:
types:
- opened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Get Changed Files from Pull Request
if: ${{ !cancelled() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# get file names and structure as JSON
files=$(gh api /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files -q '.[] | select(.status != "removed") | .filename | select(test("(.yaml|yml|md)$"))')
filesArray="[$(echo "$files" | sed -e 's/^/"/' -e 's/$/"/' -e 's/ /", "/g' | tr '\n' , | sed 's/,$//')]"
echo "CHANGED_FILES=$filesArray" >> "$GITHUB_ENV"
- name: Output Changed Files
run: echo ${{ env.CHANGED_FILES }}

- name: Vale
uses: errata-ai/vale-action@reviewdog
if: ${{ !cancelled() }}
with:
files: ${{ env.CHANGED_FILES }}
reporter: github-pr-review
filter_mode: diff_context
1 change: 0 additions & 1 deletion .hyperlint/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ authorized_users:
- RebeccaTamachiro
style_guide:
enabled: true
unmanaged_vale: true
6 changes: 3 additions & 3 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
StylesPath = .github/styles
MinAlertLevel = suggestion
IgnoredScopes = code, tt, img, url, a
IgnoredScopes = code, tt, img
SkippedScopes = script, style, pre, figure, code

[formats]
yml = yaml
mdx = md

[*]
# Ignore code surrounded by backticks or plus sign, parameters defaults, URLs, and angle brackets.
TokenIgnores = (<\/?[A-Z].+>), (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+), (http[^\n]+\[), (https[^\n]+\[)
# Ignore code surrounded by backticks or plus sign, parameters defaults, and angle brackets.
TokenIgnores = (<\/?[A-Z].+>), (\x60[^\n\x60]+\x60), ([^\n]+=[^\n]*), (\+[^\n]+\+)

[*.md]
BasedOnStyles = cloudflare
Expand Down
18 changes: 16 additions & 2 deletions src/content/docs/ai-gateway/configuration/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,30 @@ description: Override caching settings on a per-request basis.

import { TabItem, Tabs } from "~/components";

And let's see whether it finds [the link](http://localhost:1111/rules/url-forwarding/single-redirects/settings/)
kodster28 marked this conversation as resolved.
Show resolved Hide resolved

Enable and customize your gateway cache to serve requests directly from Cloudflare’s cache, instead of the original model provider, for faster requests and cost savings.

Or [this link](https://github.com/cloudflare-docs).

Or [this one](https://developers.cloudflare.com/test/).
kodster28 marked this conversation as resolved.
Show resolved Hide resolved

Or [this one](https://developers.cloudflare.com/test2/).
kodster28 marked this conversation as resolved.
Show resolved Hide resolved

What about [this page](/test/).
kodster28 marked this conversation as resolved.
Show resolved Hide resolved

:::note

Currently caching is supported only for text and image responses, and it applies only to identical requests. This is helpful for use cases when there are limited prompt options - for example, a support bot that asks "How can I help you?" and lets the user select an answer from a limited set of options works well with the current caching configuration.
We plan on adding semantic search for caching in the future to improve cache hit rates.
:::

Okay, but you can catch this thing, i.e., the latin stuff.
kodster28 marked this conversation as resolved.
Show resolved Hide resolved

## Default configuration

<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">
<Tabs syncKey="dashPlusAPI">
<TabItem label="Dashboard">

To set the default caching configuration in the dashboard:

Expand All @@ -29,7 +42,8 @@ To set the default caching configuration in the dashboard:
4. Enable **Cache Responses**.
5. Change the default caching to whatever value you prefer.

</TabItem> <TabItem label="API">
</TabItem>
<TabItem label="API">

To set the default caching configuration using the API:

Expand Down
Loading