diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d381a4e1d..488e2da59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1.2" bundler-cache: true - working-directory: jekyll-kuma-plugins run: bundle install @@ -58,6 +57,7 @@ jobs: --exclude https://linux.die.net \ --exclude https://packages.konghq.com \ --exclude https://twitter.com \ + --exclude https://coredns.io \ --max-connections-per-host=8 \ --max-response-body-size 100000000 \ --rate-limit 50 \ @@ -75,6 +75,7 @@ jobs: --exclude https://linux.die.net \ --exclude https://packages.konghq.com \ --exclude https://twitter.com \ + --exclude https://coredns.io \ --max-connections-per-host=8 \ --max-response-body-size 100000000 \ --rate-limit 50 \ diff --git a/.ruby-version b/.ruby-version index ef538c281..be94e6f53 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.2 +3.2.2 diff --git a/Gemfile b/Gemfile index bc3f14e2b..5a48accc5 100644 --- a/Gemfile +++ b/Gemfile @@ -3,20 +3,15 @@ source 'https://rubygems.org' gem 'jekyll', '~> 4.2' gem 'liquid-c' gem 'rouge', '3.30.0' +gem 'jekyll-generator-single-source' -group :jekyll_plugins do - gem 'jekyll-paginate-v2' - gem 'jekyll-last-modified-at' - gem 'jekyll-contentblocks' - gem 'jekyll-vite' - gem 'jekyll-generator-single-source' - gem 'jekyll-kuma-plugins', path: './jekyll-kuma-plugins' -end +gem 'jekyll-paginate-v2' +gem 'jekyll-last-modified-at' +gem 'jekyll-contentblocks' +gem 'jekyll-vite' +gem 'jekyll-kuma-plugins', path: './jekyll-kuma-plugins' group :development do - # Webrick is no longer bundled with ruby 3 - # https://github.com/jekyll/jekyll/issues/8523 - gem "webrick", "~> 1.7" gem 'byebug' gem 'foreman' end diff --git a/Gemfile.lock b/Gemfile.lock index 9079b7168..bd2c0829a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -46,7 +46,8 @@ GEM webrick (~> 1.7) jekyll-contentblocks (1.2.0) jekyll - jekyll-generator-single-source (0.0.8) + jekyll-generator-single-source (0.0.15) + i18n (~> 1) jekyll (>= 4.2, < 5.0) jekyll-last-modified-at (1.3.0) jekyll (>= 3.7, < 5.0) @@ -132,7 +133,6 @@ DEPENDENCIES liquid-c rouge (= 3.30.0) rspec - webrick (~> 1.7) BUNDLED WITH 2.3.7 diff --git a/Makefile b/Makefile index c6941d301..9b7dc05ce 100644 --- a/Makefile +++ b/Makefile @@ -20,13 +20,13 @@ install: ruby-version-check bundle install run: ruby-version-check - bundle exec foreman start + netlify dev test: bundle exec rspec build: ruby-version-check - bundle exec jekyll build --config jekyll.yml --profile + exe/build # Cleans up all temp files in the build. # Run `make clean` locally whenever you're updating dependencies, or to help diff --git a/Procfile b/Procfile index 653170eaf..f2a1fa7af 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -netlify: npx netlify dev -jekyll: bundle exec jekyll serve --livereload --config jekyll-dev.yml +vite: bin/vite dev +jekyll: bin/jekyll-vite wait && bundle exec jekyll serve --livereload --config jekyll-dev.yml --profile diff --git a/app/_data/docs_nav_kuma_dev.yml b/app/_data/docs_nav_kuma_2.10.x.yml similarity index 99% rename from app/_data/docs_nav_kuma_dev.yml rename to app/_data/docs_nav_kuma_2.10.x.yml index ea352ecf2..494e30231 100644 --- a/app/_data/docs_nav_kuma_dev.yml +++ b/app/_data/docs_nav_kuma_2.10.x.yml @@ -1,5 +1,6 @@ generate: true assume_generated: true +release: 2.10.x items: - title: Introduction group: true diff --git a/app/_data/docs_nav_kuma_2.6.x.yml b/app/_data/docs_nav_kuma_2.6.x.yml index 198539090..e1bdad94a 100644 --- a/app/_data/docs_nav_kuma_2.6.x.yml +++ b/app/_data/docs_nav_kuma_2.6.x.yml @@ -1,3 +1,4 @@ +release: 2.6.x generate: true assume_generated: true items: diff --git a/app/_data/docs_nav_kuma_2.7.x.yml b/app/_data/docs_nav_kuma_2.7.x.yml index 1f2c5f3ea..390fa6cc0 100644 --- a/app/_data/docs_nav_kuma_2.7.x.yml +++ b/app/_data/docs_nav_kuma_2.7.x.yml @@ -1,5 +1,6 @@ generate: true assume_generated: true +release: 2.7.x items: - title: Introduction group: true diff --git a/app/_data/docs_nav_kuma_2.8.x.yml b/app/_data/docs_nav_kuma_2.8.x.yml index 88527ae30..5bb157281 100644 --- a/app/_data/docs_nav_kuma_2.8.x.yml +++ b/app/_data/docs_nav_kuma_2.8.x.yml @@ -1,5 +1,6 @@ generate: true assume_generated: true +release: 2.8.x items: - title: Introduction group: true diff --git a/app/_data/docs_nav_kuma_2.9.x.yml b/app/_data/docs_nav_kuma_2.9.x.yml index ea352ecf2..e4fb4b119 100644 --- a/app/_data/docs_nav_kuma_2.9.x.yml +++ b/app/_data/docs_nav_kuma_2.9.x.yml @@ -1,5 +1,6 @@ generate: true assume_generated: true +release: 2.9.x items: - title: Introduction group: true diff --git a/app/_data/versions.yml b/app/_data/versions.yml index 5314e358e..e922853e0 100644 --- a/app/_data/versions.yml +++ b/app/_data/versions.yml @@ -103,6 +103,7 @@ endOfLifeDate: "2025-10-22" branch: release-2.9 - edition: kuma - version: preview - release: dev + version: 2.10.0 + release: 2.10.x + label: dev branch: master diff --git a/app/_includes/sidebar.html b/app/_includes/sidebar.html index 0c69a45f6..0e46541a6 100644 --- a/app/_includes/sidebar.html +++ b/app/_includes/sidebar.html @@ -14,5 +14,5 @@ {%- endif %} - {% include sidebar_links.html nav_items=page.nav_items version=page.version depth=0 %} + {% include sidebar_links.html nav_items=page.nav_items release=page.release depth=0 %} diff --git a/app/_includes/sidebar_group.html b/app/_includes/sidebar_group.html index 3677adb14..488cee41e 100644 --- a/app/_includes/sidebar_group.html +++ b/app/_includes/sidebar_group.html @@ -8,5 +8,5 @@ {% assign children_depth = depth | plus: 1 %} - {% include sidebar_links.html nav_items=item.items depth=children_depth cssClass='sidebar-group-items hidden' version=include.version %} + {% include sidebar_links.html nav_items=item.items depth=children_depth cssClass='sidebar-group-items hidden' release=include.release %} diff --git a/app/_includes/sidebar_link.html b/app/_includes/sidebar_link.html index 30a516c7c..782f0b052 100644 --- a/app/_includes/sidebar_link.html +++ b/app/_includes/sidebar_link.html @@ -2,7 +2,7 @@ {% assign current_page = page.url | remove: '.html' %} {% if item.absolute_url %}{% assign url = item.url %} -{% else %}{% assign url = '/docs/' | append: include.version | append: item.url %} +{% else %}{% assign url = '/docs/' | append: include.release | append: item.url %} {% endif %} {{ item.text or item.title }} @@ -11,7 +11,7 @@ {% for sub_item in item.items %}
Careful!
- {% if current_version == 'dev' %} -You are browsing documentation for the next version of {{ site.title }}. Use this version at your own risk.
- {% else %} -You are browsing documentation for a version of {{ site.title }} that is not the latest release.
- {% endif %} +{% if current_release %} + {% unless current_release.latest? %} +Careful!
+ {% if current_release.label == 'dev' %} +You are browsing documentation for the next version of {{ site.title }}. Use this version at your own risk.
+ {% else %} +You are browsing documentation for a version of {{ site.title }} that is not the latest release.
+ {% endif %} - {% if latest_page != nil %} -- Go here to browse the documentation for the latest version. -
- {% endif %} - {% if current_version != 'dev' %} -Looking for even older versions? Learn more.
- {% endif %} + {% if latest_page != nil %} ++ Go here to browse the documentation for the latest version. +
+ {% endif %} +apiVersion: kuma.io/v1alpha1
@@ -226,7 +226,7 @@
>
-
+
type: MeshHTTPRoute
diff --git a/spec/fixtures/mhr-port.golden.html b/spec/fixtures/mhr-port.golden.html
index 499359eb4..33f342248 100644
--- a/spec/fixtures/mhr-port.golden.html
+++ b/spec/fixtures/mhr-port.golden.html
@@ -45,7 +45,7 @@
>
-
+
apiVersion: kuma.io/v1alpha1
@@ -138,7 +138,7 @@
>
-
+
type: MeshHTTPRoute
diff --git a/spec/fixtures/mhr-port_dev.golden.html b/spec/fixtures/mhr-port_dev.golden.html
new file mode 100644
index 000000000..000de0bd8
--- /dev/null
+++ b/spec/fixtures/mhr-port_dev.golden.html
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+ -
+
+ Kubernetes
+
+
+
+ -
+
+ Universal
+
+
+
+
+
+
+
+
+
+
+
+
+
+apiVersion: kuma.io/v1alpha1
+kind: MeshHTTPRoute
+metadata:
+ name: http-route-1
+ namespace: kuma-demo
+ labels:
+ kuma.io/mesh: default
+spec:
+ targetRef:
+ kind: MeshSubset
+ tags:
+ app: frontend
+ to:
+ - targetRef:
+ kind: MeshService
+ name: backend_kuma-demo_svc_3001
+ rules:
+ - matches:
+ - headers:
+ - type: Exact
+ name: mirror-this-request
+ value: 'true'
+ default:
+ filters:
+ - type: RequestMirror
+ requestMirror:
+ percentage: 30
+ backendRef:
+ kind: MeshServiceSubset
+ name: backend_kuma-demo_svc_3001
+ tags:
+ version: experimental
+ backendRefs:
+ - kind: MeshService
+ name: backend_kuma-demo_svc_3001
+
+
+apiVersion: kuma.io/v1alpha1
+kind: MeshHTTPRoute
+metadata:
+ name: http-route-1
+ namespace: kuma-demo
+ labels:
+ kuma.io/mesh: default
+spec:
+ targetRef:
+ kind: MeshSubset
+ tags:
+ app: frontend
+ to:
+ - targetRef:
+ kind: MeshService
+ name: backend
+ namespace: kuma-demo
+ sectionName: http
+ rules:
+ - matches:
+ - headers:
+ - type: Exact
+ name: mirror-this-request
+ value: 'true'
+ default:
+ filters:
+ - type: RequestMirror
+ requestMirror:
+ percentage: 30
+ backendRef:
+ kind: MeshService
+ name: backend-experimental
+ namespace: kuma-demo
+ port: 3001
+ backendRefs:
+ - kind: MeshService
+ name: backend
+ namespace: kuma-demo
+ port: 3001
+
+
+
+
+
+
+
+
+
diff --git a/spec/fixtures/mhr-port_edition.golden.html b/spec/fixtures/mhr-port_edition.golden.html
new file mode 100644
index 000000000..5a6c51c34
--- /dev/null
+++ b/spec/fixtures/mhr-port_edition.golden.html
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+ -
+
+ Kubernetes
+
+
+
+ -
+
+ Universal
+
+
+
+
+
+
+
+
+
+
+
+
+
+apiVersion: kuma.io/v1alpha1
+kind: MeshHTTPRoute
+metadata:
+ name: http-route-1
+ namespace: kuma-demo
+ labels:
+ kuma.io/mesh: default
+spec:
+ targetRef:
+ kind: MeshSubset
+ tags:
+ app: frontend
+ to:
+ - targetRef:
+ kind: MeshService
+ name: backend_kuma-demo_svc_3001
+ rules:
+ - matches:
+ - headers:
+ - type: Exact
+ name: mirror-this-request
+ value: 'true'
+ default:
+ filters:
+ - type: RequestMirror
+ requestMirror:
+ percentage: 30
+ backendRef:
+ kind: MeshServiceSubset
+ name: backend_kuma-demo_svc_3001
+ tags:
+ version: experimental
+ backendRefs:
+ - kind: MeshService
+ name: backend_kuma-demo_svc_3001
+
+
+apiVersion: kuma.io/v1alpha1
+kind: MeshHTTPRoute
+metadata:
+ name: http-route-1
+ namespace: kuma-demo
+ labels:
+ kuma.io/mesh: default
+spec:
+ targetRef:
+ kind: MeshSubset
+ tags:
+ app: frontend
+ to:
+ - targetRef:
+ kind: MeshService
+ name: backend
+ namespace: kuma-demo
+ sectionName: http
+ rules:
+ - matches:
+ - headers:
+ - type: Exact
+ name: mirror-this-request
+ value: 'true'
+ default:
+ filters:
+ - type: RequestMirror
+ requestMirror:
+ percentage: 30
+ backendRef:
+ kind: MeshService
+ name: backend-experimental
+ namespace: kuma-demo
+ port: 3001
+ backendRefs:
+ - kind: MeshService
+ name: backend
+ namespace: kuma-demo
+ port: 3001
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spec/fixtures/mt-with-from-and-meshservice-in-to.golden.html b/spec/fixtures/mt-with-from-and-meshservice-in-to.golden.html
index 8428f9059..2dbabe890 100644
--- a/spec/fixtures/mt-with-from-and-meshservice-in-to.golden.html
+++ b/spec/fixtures/mt-with-from-and-meshservice-in-to.golden.html
@@ -45,7 +45,7 @@
>
-
+
apiVersion: kuma.io/v1alpha1
@@ -112,7 +112,7 @@
>
-
+
type: MeshTimeout
diff --git a/spec/fixtures/mtr.golden.html b/spec/fixtures/mtr.golden.html
index fd5651091..f0bed0438 100644
--- a/spec/fixtures/mtr.golden.html
+++ b/spec/fixtures/mtr.golden.html
@@ -45,7 +45,7 @@
>
-
+
apiVersion: kuma.io/v1alpha1
@@ -124,7 +124,7 @@
>
-
+
type: MeshTCPRoute
diff --git a/spec/kuma_plugins/liquid/tags/inc_spec.rb b/spec/kuma_plugins/liquid/tags/inc_spec.rb
index f1a7dcd0e..9c2b49ae3 100644
--- a/spec/kuma_plugins/liquid/tags/inc_spec.rb
+++ b/spec/kuma_plugins/liquid/tags/inc_spec.rb
@@ -1,9 +1,7 @@
RSpec.describe Jekyll::KumaPlugins::Liquid::Tags::Inc do
let(:version) { '2.9.1' }
- # If we ever upgrade jekyll-generator-single-source we will have to change below to:
- # let(:release) { Jekyll::GeneratorSingleSource::Product::Release.new({ 'release' => version }) }
- # let(:page) { { 'release' => release.to_liquid } }
- let(:page) { { 'version' => version } }
+ let(:release) { Jekyll::GeneratorSingleSource::Product::Release.new({ 'release' => version }) }
+ let(:page) { { 'release' => release.to_liquid } }
let(:environment) { { 'page' => page } }
let(:registers) { { page: page } }
let(:liquid_context) { Liquid::Context.new(environment, {}, registers) }
@@ -13,7 +11,7 @@
it "renders correctly for: {% inc #{tag_params} %} in context" do
template = <<~LIQUID
- {% assign docs = "/docs/" | append: page.version %}
+ {% assign docs = "/docs/" | append: page.release %}
{% assign link = docs | append: "/networking/transparent-proxying/" %}
{% if_version #{if_version} %}
diff --git a/spec/kuma_plugins/liquid/tags/policy_yaml_spec.rb b/spec/kuma_plugins/liquid/tags/policy_yaml_spec.rb
index e70210379..db50bb54c 100644
--- a/spec/kuma_plugins/liquid/tags/policy_yaml_spec.rb
+++ b/spec/kuma_plugins/liquid/tags/policy_yaml_spec.rb
@@ -1,12 +1,11 @@
RSpec.describe Jekyll::KumaPlugins::Liquid::Tags::PolicyYaml do
# Set up the Jekyll site and context for testing
- let(:site) { Jekyll::Site.new(Jekyll.configuration({mesh_namespace: "kuma-demo"})) }
- let(:page) { { 'version' => '2.9.1' } } # This sets the version key for testing
- let(:registers) { { :page => page, :site => site } }
- let(:context) { Liquid::Context.new({}, {}, registers) }
- shared_examples 'policy yaml rendering' do |input_file, golden_file, tag_options|
+ shared_examples 'policy yaml rendering' do |input_file, golden_file, tag_options, release|
it "renders correctly for #{input_file}" do
+ site = Jekyll::Site.new(Jekyll.configuration({mesh_namespace: "kuma-demo"}))
+ release = {'release' => '2.9.x', 'edition' => 'kuma'} unless release # This sets the version key for testing
+ context = Liquid::Context.new({}, {}, { :page => {'edition' => release['edition'], 'release' => Jekyll::GeneratorSingleSource::Product::Release.new(release)}, :site => site})
content = GoldenFileManager.load_input(input_file)
tag_content = tag_options ? "{% policy_yaml my-tabs #{tag_options} %}" : "{% policy_yaml my-tabs %}"
template = Liquid::Template.parse("#{tag_content}#{content}{% endpolicy_yaml %}")
@@ -42,13 +41,26 @@
golden_file: 'spec/fixtures/mhr-port.golden.html',
tag_options: 'use_meshservice=true'
},
+ {
+ input_file: 'spec/fixtures/mhr-port.yaml',
+ golden_file: 'spec/fixtures/mhr-port_edition.golden.html',
+ tag_options: 'use_meshservice=true',
+ page: { 'release' => '2.10.x', 'edition' => 'mesh' }
+ },
+ {
+ input_file: 'spec/fixtures/mhr-port.yaml',
+ golden_file: 'spec/fixtures/mhr-port_dev.golden.html',
+ tag_options: 'use_meshservice=true',
+ page: { 'release' => '2.10.x', 'edition' => 'kuma', 'label' => 'dev' }
+ },
]
test_cases.each do |test_case|
include_examples 'policy yaml rendering',
test_case[:input_file],
test_case[:golden_file],
- test_case[:tag_options]
+ test_case[:tag_options],
+ test_case[:page]
end
end
end