From e1311a87b88863bbfd67363846777ddb26f4f784 Mon Sep 17 00:00:00 2001 From: Igwe Kalu Date: Mon, 18 Sep 2023 16:48:15 +0200 Subject: [PATCH 01/21] Declare offering delivery method and unit. This change should facilitate implementation of automations that consumes the offering feed e.g. scoping enhancement https://github.com/github/services/pull/19929 --- _offerings/bundle-ghas-getting-started.md | 3 +++ _offerings/offering-actions-training.md | 5 ++++- .../offering-admin-training-(github-enterprise-cloud).md | 3 +++ .../offering-admin-training-(github-enterprise-server).md | 3 +++ _offerings/offering-api-training.md | 3 +++ _offerings/offering-codeql-query-customizations.md | 5 ++++- _offerings/offering-codeql-query-development.md | 5 ++++- .../offering-codeql-query-writing-tailored-workshop.md | 3 +++ _offerings/offering-codeql-query-writing-training.md | 3 +++ _offerings/offering-copilot-for-business-fundamentals.md | 5 ++++- _offerings/offering-ghas-developer-training.md | 3 +++ _offerings/offering-ghas-pilot-team-implementation.md | 3 +++ _offerings/offering-ghas-rollout-deployment-training.md | 3 +++ _offerings/offering-ghas-security-advisory-services.md | 3 +++ _offerings/offering-ghas-security-results-review.md | 3 +++ _offerings/offering-ghas-security-team-training.md | 3 +++ _offerings/offering-github-for-developers-training.md | 3 +++ _offerings/offering-github-for-non-developers-training.md | 3 +++ .../offering-implementation-(github-enterprise-cloud).md | 3 +++ .../offering-implementation-(github-enterprise-server).md | 3 +++ _offerings/offering-migrations-emu.md | 3 +++ _offerings/offering-migrations.md | 3 +++ _offerings/offering-technical-advisory-services.md | 3 +++ _offerings/offering-workflow-consultation.md | 3 +++ 24 files changed, 76 insertions(+), 4 deletions(-) diff --git a/_offerings/bundle-ghas-getting-started.md b/_offerings/bundle-ghas-getting-started.md index 441a65c..ee14560 100644 --- a/_offerings/bundle-ghas-getting-started.md +++ b/_offerings/bundle-ghas-getting-started.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Advanced Security - Getting Started +delivery: + method: Bundled delivery, see bundle description. + unit: Bundle description: Supports you in "Getting Started" with GitHub Advanced Security (GHAS) and helps accelerate adoption in the critical first few weeks of deployment. parameterized_name: bundle-ghas-getting-started --- diff --git a/_offerings/offering-actions-training.md b/_offerings/offering-actions-training.md index c273968..e169e2b 100644 --- a/_offerings/offering-actions-training.md +++ b/_offerings/offering-actions-training.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Actions Training +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: This training will enable your teams to start leveraging GitHub Actions in their own projects across a multitude of use cases. parameterized_name: actions-training --- @@ -30,7 +33,7 @@ GitHub Actions allow you to automate your workflows. This training will enable y ### Remote -- Unit of Delivery: class +- Unit of Delivery: Class - Participants: maximum 16 students ## Syllabus diff --git a/_offerings/offering-admin-training-(github-enterprise-cloud).md b/_offerings/offering-admin-training-(github-enterprise-cloud).md index 05f4e72..aff79c8 100644 --- a/_offerings/offering-admin-training-(github-enterprise-cloud).md +++ b/_offerings/offering-admin-training-(github-enterprise-cloud).md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Admin Training (GitHub Enterprise Cloud) +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: Prepare your GitHub Enterprise Cloud Administrators to maintain a healthy GitHub environment that supports the needs of your development team. parameterized_name: admin-training-github-enterprise-cloud --- diff --git a/_offerings/offering-admin-training-(github-enterprise-server).md b/_offerings/offering-admin-training-(github-enterprise-server).md index 0c5b9e7..f967edd 100644 --- a/_offerings/offering-admin-training-(github-enterprise-server).md +++ b/_offerings/offering-admin-training-(github-enterprise-server).md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Admin Training (GitHub Enterprise Server) +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: Prepare your GitHub Enterprise Server Administrators to maintain a healthy, scalable GitHub environment that supports the needs of your development team. parameterized_name: admin-training-github-enterprise-server --- diff --git a/_offerings/offering-api-training.md b/_offerings/offering-api-training.md index 1fdf931..797ace8 100644 --- a/_offerings/offering-api-training.md +++ b/_offerings/offering-api-training.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub API Training +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: GitHub’s extensive API allows you to extend the platform to accommodate most modern workflows and easily get the data you need. parameterized_name: api-training --- diff --git a/_offerings/offering-codeql-query-customizations.md b/_offerings/offering-codeql-query-customizations.md index dab6456..65acf6b 100644 --- a/_offerings/offering-codeql-query-customizations.md +++ b/_offerings/offering-codeql-query-customizations.md @@ -1,7 +1,10 @@ --- layout: page title: CodeQL Query Customizations -description: Commision GitHub to customize the existing CodeQL queries to provide better results for your organization. +delivery: + method: "`40` hours of enablement and workshops." + unit: Workshop +description: Commission GitHub to customize the existing CodeQL queries to provide better results for your organization. parameterized_name: codeql-query-customizations --- diff --git a/_offerings/offering-codeql-query-development.md b/_offerings/offering-codeql-query-development.md index 93ab5da..58773b0 100644 --- a/_offerings/offering-codeql-query-development.md +++ b/_offerings/offering-codeql-query-development.md @@ -1,7 +1,10 @@ --- layout: page title: CodeQL Query Development -description: Commision GitHub to develop CodeQL queries based on your unique business needs. +delivery: + method: "`40` hours of enablement and workshops." + unit: Workshop +description: Commission GitHub to develop CodeQL queries based on your unique business needs. parameterized_name: codeql-query-development --- diff --git a/_offerings/offering-codeql-query-writing-tailored-workshop.md b/_offerings/offering-codeql-query-writing-tailored-workshop.md index 48eb5b0..3675d44 100644 --- a/_offerings/offering-codeql-query-writing-tailored-workshop.md +++ b/_offerings/offering-codeql-query-writing-tailored-workshop.md @@ -1,6 +1,9 @@ --- layout: page title: CodeQL Query Writing Tailored Workshop +delivery: + method: "`3` hours per day over 2 days." + unit: Workshop description: This engagement creates a tailored 2 hour training course for using CodeQL to find a security vulnerbility or pattern of your choice. parameterized_name: codeql-query-writing-tailored-workshop --- diff --git a/_offerings/offering-codeql-query-writing-training.md b/_offerings/offering-codeql-query-writing-training.md index 2809dbf..c3112ed 100644 --- a/_offerings/offering-codeql-query-writing-training.md +++ b/_offerings/offering-codeql-query-writing-training.md @@ -1,6 +1,9 @@ --- layout: page title: CodeQL Query Writing Training +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: Learn how to write CodeQL to find new security vulnerabilities or customize the existing rules through our extensive catalog of 2 hour training courses. parameterized_name: codeql-query-writing-training --- diff --git a/_offerings/offering-copilot-for-business-fundamentals.md b/_offerings/offering-copilot-for-business-fundamentals.md index 0f1070e..90e5a20 100644 --- a/_offerings/offering-copilot-for-business-fundamentals.md +++ b/_offerings/offering-copilot-for-business-fundamentals.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Copilot for Business Fundamentals Training +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: GitHub Copilot is the world’s first at-scale AI developer tool. Sitting within the editor as a simple extension, GitHub Copilot draws context from a developer’s code to suggest new lines, entire functions, tests, and even complex algorithms. parameterized_name: copilot-for-business-fundamentals-training --- @@ -37,7 +40,7 @@ Adopting GitHub Copilot can help companies improve their development processes, ### Remote -- Unit of Delivery: class +- Unit of Delivery: Class - Participants: maximum 16 students ### Syllabus diff --git a/_offerings/offering-ghas-developer-training.md b/_offerings/offering-ghas-developer-training.md index ca69118..d44179d 100644 --- a/_offerings/offering-ghas-developer-training.md +++ b/_offerings/offering-ghas-developer-training.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Advanced Security - Developer Training +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: Allows you to have a "developer-first" approach to Application Security, recognizing that developers have a critical role to play in securing your applications. parameterized_name: ghas-developer-training --- diff --git a/_offerings/offering-ghas-pilot-team-implementation.md b/_offerings/offering-ghas-pilot-team-implementation.md index ce66d3c..9efeff8 100644 --- a/_offerings/offering-ghas-pilot-team-implementation.md +++ b/_offerings/offering-ghas-pilot-team-implementation.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Advanced Security - Pilot Team Implementation +delivery: + method: "`6` hours maximum sync time." + unit: Workshop description: In this engagement we will work with a pilot or lighthouse team to help them enable GitHub Advanced Security for one or more key repositories. parameterized_name: ghas-pilot-team-implementation --- diff --git a/_offerings/offering-ghas-rollout-deployment-training.md b/_offerings/offering-ghas-rollout-deployment-training.md index 87d17f6..1735bb2 100644 --- a/_offerings/offering-ghas-rollout-deployment-training.md +++ b/_offerings/offering-ghas-rollout-deployment-training.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Advanced Security - Rollout and Deployment Training +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: Provides support during the planning phases by providing best practices, recommended rollout strategies and identifying common pitfalls and issues. parameterized_name: ghas-rollout-deployment-training --- diff --git a/_offerings/offering-ghas-security-advisory-services.md b/_offerings/offering-ghas-security-advisory-services.md index d6f9125..e5d2677 100644 --- a/_offerings/offering-ghas-security-advisory-services.md +++ b/_offerings/offering-ghas-security-advisory-services.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Advanced Security - Security Advisory Services +delivery: + method: "A minimum committed hours of 4 hours per week; committed hours may be more based on contract duration." + unit: Days description: Identify your organization’s top priorities for improving your Secure Software Development Lifecycle with GitHub Advanced Security. parameterized_name: ghas-security-advisory-services --- diff --git a/_offerings/offering-ghas-security-results-review.md b/_offerings/offering-ghas-security-results-review.md index e46ce5d..bb0311f 100644 --- a/_offerings/offering-ghas-security-results-review.md +++ b/_offerings/offering-ghas-security-results-review.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Advanced Security - Results Review +delivery: + method: "`6` hours maximum sync time" + unit: Workshop description: Allows you to have a “developer-first” approach to Application Security, recognizing that developers have a critical role to play in securing your applications. parameterized_name: ghas-security-results-review --- diff --git a/_offerings/offering-ghas-security-team-training.md b/_offerings/offering-ghas-security-team-training.md index b635787..3a82ee2 100644 --- a/_offerings/offering-ghas-security-team-training.md +++ b/_offerings/offering-ghas-security-team-training.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Advanced Security - Security Team Training +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: Supports those who are responsible for reviewing, monitoring and driving remediation of security results across an enterprise. parameterized_name: ghas-security-team-training --- diff --git a/_offerings/offering-github-for-developers-training.md b/_offerings/offering-github-for-developers-training.md index 3374074..3067004 100644 --- a/_offerings/offering-github-for-developers-training.md +++ b/_offerings/offering-github-for-developers-training.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub for Developers Training +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: Give your developers confidence with Git and GitHub with hands-on, practical training from GitHub Expert Services. parameterized_name: github-for-developers-training --- diff --git a/_offerings/offering-github-for-non-developers-training.md b/_offerings/offering-github-for-non-developers-training.md index fefc855..6f8a4bb 100644 --- a/_offerings/offering-github-for-non-developers-training.md +++ b/_offerings/offering-github-for-non-developers-training.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub for Non-Developers +delivery: + method: "`3` hours per day over 2 days." + unit: Class description: Opening GitHub to a broad audience in your organization, gives your developers access to the expertise and diverse ways of thinking that represent your entire user population. parameterized_name: github-for-non-developers-training --- diff --git a/_offerings/offering-implementation-(github-enterprise-cloud).md b/_offerings/offering-implementation-(github-enterprise-cloud).md index 309e666..05085a6 100644 --- a/_offerings/offering-implementation-(github-enterprise-cloud).md +++ b/_offerings/offering-implementation-(github-enterprise-cloud).md @@ -1,6 +1,9 @@ --- layout: page title: Implementation (GitHub Enterprise Cloud) +delivery: + method: "`6` hours maximum sync time" + unit: Class description: Equip your team with the knowledge they need to configure and manage your GitHub Enterprise Cloud account. parameterized_name: implementation-github-enterprise-cloud --- diff --git a/_offerings/offering-implementation-(github-enterprise-server).md b/_offerings/offering-implementation-(github-enterprise-server).md index c9eb291..007afd7 100644 --- a/_offerings/offering-implementation-(github-enterprise-server).md +++ b/_offerings/offering-implementation-(github-enterprise-server).md @@ -1,6 +1,9 @@ --- layout: page title: Implementation (GitHub Enterprise Server) +delivery: + method: "`6` hours maximum sync time" + unit: Class description: Equip your team with the knowledge they need to configure and manage your GitHub Enterprise Server account. parameterized_name: implementation-github-enterprise-server --- diff --git a/_offerings/offering-migrations-emu.md b/_offerings/offering-migrations-emu.md index 0db4b0e..d28062d 100644 --- a/_offerings/offering-migrations-emu.md +++ b/_offerings/offering-migrations-emu.md @@ -1,6 +1,9 @@ --- layout: page title: Migrations to GitHub Enterprise (GitHub Enterprise Cloud to GitHub Enterprise Cloud EMU) +delivery: + method: "`40` hours of enablement and workshops." + unit: Workshop description: Ensure your GitHub Enterprise Cloud data is migrated to your GitHub Enterprise Cloud plus Enterprise Managed Users (EMU) platform account accurately and efficiently. parameterized_name: migrations-emu --- diff --git a/_offerings/offering-migrations.md b/_offerings/offering-migrations.md index 7a41699..dca4d7b 100644 --- a/_offerings/offering-migrations.md +++ b/_offerings/offering-migrations.md @@ -1,6 +1,9 @@ --- layout: page title: Migrations to GitHub Enterprise (Standard) +delivery: + method: "`40` hours of enablement and workshops." + unit: Workshop description: Ensure your Version Control System (VCS) data is migrated to your GitHub Enterprise platform account accurately and efficiently. parameterized_name: migrations --- diff --git a/_offerings/offering-technical-advisory-services.md b/_offerings/offering-technical-advisory-services.md index c42fd73..fd12239 100644 --- a/_offerings/offering-technical-advisory-services.md +++ b/_offerings/offering-technical-advisory-services.md @@ -1,6 +1,9 @@ --- layout: page title: GitHub Technical Advisory Services +delivery: + method: "A minimum committed hours of 4 hours per week; committed hours may be more based on contract duration." + unit: Days description: Identify your organization's top priorities for improving software delivery and enabling a digital transformation. parameterized_name: technical-advisory-services --- diff --git a/_offerings/offering-workflow-consultation.md b/_offerings/offering-workflow-consultation.md index b404761..a418a5f 100644 --- a/_offerings/offering-workflow-consultation.md +++ b/_offerings/offering-workflow-consultation.md @@ -1,6 +1,9 @@ --- layout: page title: Workflow Consultation +delivery: + method: "`6` hours maximum sync time." + unit: Session description: Equip your team with the knowledge they need to evaluate, implement, document, and design a workflow solution optimized for your branching and release management strategy. parameterized_name: workflow-consultation --- From da3a87a45f59f19ff6492e4d01ffae9e48872b2d Mon Sep 17 00:00:00 2001 From: Igwe Kalu Date: Mon, 18 Sep 2023 23:56:24 +0200 Subject: [PATCH 02/21] Fix phrasing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stefan Stölzle --- _offerings/offering-ghas-security-advisory-services.md | 2 +- _offerings/offering-technical-advisory-services.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_offerings/offering-ghas-security-advisory-services.md b/_offerings/offering-ghas-security-advisory-services.md index e5d2677..56f6cdb 100644 --- a/_offerings/offering-ghas-security-advisory-services.md +++ b/_offerings/offering-ghas-security-advisory-services.md @@ -2,7 +2,7 @@ layout: page title: GitHub Advanced Security - Security Advisory Services delivery: - method: "A minimum committed hours of 4 hours per week; committed hours may be more based on contract duration." + method: "A minimum commitment of 4 hours per week; committed hours may be more based on contract duration." unit: Days description: Identify your organization’s top priorities for improving your Secure Software Development Lifecycle with GitHub Advanced Security. parameterized_name: ghas-security-advisory-services diff --git a/_offerings/offering-technical-advisory-services.md b/_offerings/offering-technical-advisory-services.md index fd12239..b74b1c9 100644 --- a/_offerings/offering-technical-advisory-services.md +++ b/_offerings/offering-technical-advisory-services.md @@ -2,7 +2,7 @@ layout: page title: GitHub Technical Advisory Services delivery: - method: "A minimum committed hours of 4 hours per week; committed hours may be more based on contract duration." + method: "A minimum commitment of 4 hours per week; committed hours may be more based on contract duration." unit: Days description: Identify your organization's top priorities for improving software delivery and enabling a digital transformation. parameterized_name: technical-advisory-services From 6b8742527ced73cdae9308374797a0f1e6176169 Mon Sep 17 00:00:00 2001 From: Igwe Kalu Date: Tue, 19 Sep 2023 11:22:13 +0200 Subject: [PATCH 03/21] Revert "Add delivery entry to feed item" This reverts commit 5f06e2817a20d481e5f69d28d6d8379b00cf5311. --- feed.json | 1 - 1 file changed, 1 deletion(-) diff --git a/feed.json b/feed.json index 9fbdcbb..297aba4 100644 --- a/feed.json +++ b/feed.json @@ -14,7 +14,6 @@ permalink: feed.json "lead": {{ post.description | jsonify }}, "content": {{ post.content | jsonify }}, "parameterized_name": {{ post.parameterized_name | jsonify }}, - "delivery": {{ post.delivery | jsonify }}, "date_published": "{{ post.date | date_to_xmlschema }}" } {% unless forloop.last %},{% endunless %}{% endfor %} From e75310f2d4c5dfa9851ac7e0476a1efd75fb7ebd Mon Sep 17 00:00:00 2001 From: Igwe Kalu Date: Tue, 19 Sep 2023 10:55:32 +0200 Subject: [PATCH 04/21] Fix feed document: make delivery entry an object Delivery entry in post item should be an object. --- feed.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feed.json b/feed.json index 297aba4..050b94b 100644 --- a/feed.json +++ b/feed.json @@ -14,7 +14,8 @@ permalink: feed.json "lead": {{ post.description | jsonify }}, "content": {{ post.content | jsonify }}, "parameterized_name": {{ post.parameterized_name | jsonify }}, - "date_published": "{{ post.date | date_to_xmlschema }}" + "date_published": "{{ post.date | date_to_xmlschema }}", + "delivery": {{ post.delivery | jsonify }}, } {% unless forloop.last %},{% endunless %}{% endfor %} ] From 7e9a6ad7374725c5f5cb8b12a79500537c39f224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:16:33 +0200 Subject: [PATCH 05/21] =?UTF-8?q?=E2=9C=85=20Add=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++ Gemfile | 4 ++++ Rakefile | 28 +++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 Rakefile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..af7048d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: GitHub Expert Feed CI + +on: + pull_request: + branches: ['main'] + +permissions: + contents: read + +concurrency: + # allow only one run per branch and event + group: ci-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + ci: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac + + - name: Configure Pages + uses: actions/configure-pages@v3 + + - name: Build Pages + uses: actions/jekyll-build-pages@v1 + + - name: Setup Ruby + uses: ruby/setup-ruby@5311f05890856149502132d25c4a24985a00d426 + with: + bundler-cache: true + + - name: Check Cache + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + with: + path: _site + key: ges-ci-${{ runner.os }}-htmlproofer + + - name: Run tests + run: bundle exec rake test diff --git a/Gemfile b/Gemfile index 94c9a4d..dccde83 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,7 @@ source "https://rubygems.org" gem "jekyll", "~> 3.9.2" gem 'github-pages', '227', group: :jekyll_plugins gem 'jekyll-octicons', '17.8.0' + +group :test do + gem "rake" +end diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..ce940d2 --- /dev/null +++ b/Rakefile @@ -0,0 +1,28 @@ +#!/usr/bin/env rake +# frozen_string_literal: true + +require "json" + +task "default" => [:test] +desc "Runs the tests!" + +task "test" do + def valid_json?(json) + JSON.parse(json) + true + rescue JSON::ParserError, TypeError => e + false + end + + # test if _site/feed.json is valid + File.open("_site/feed.json", "r") do |f| + json = f.read + + if valid_json?(json) + puts "feed.json is valid" + else + puts "feed.json is not valid" + exit 1 + end + end +end From ad28839884c75237ca5d3d8e6d95bd9f67a903ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:19:46 +0200 Subject: [PATCH 06/21] =?UTF-8?q?=E2=9E=95=20Add=20.ruby-version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..06d6115 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.1.7-github From 36f2f3f2ea76b38aa0786ff8df3384ec9dbfb141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:21:58 +0200 Subject: [PATCH 07/21] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Use=20Ruby=20v3.1.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit same as https://github.com/github/services/blob/main/.ruby-version --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 06d6115..ff365e0 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1.7-github +3.1.3 From ca66d566c851b461a4e6df60b57a972e6b88a7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:25:58 +0200 Subject: [PATCH 08/21] =?UTF-8?q?=F0=9F=92=9A=20Update=20cache=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af7048d..f79cbd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 with: path: _site - key: ges-ci-${{ runner.os }}-htmlproofer + key: feed-ci-jekyll-${{ hashFiles('**/_site/feed.json') }} - name: Run tests run: bundle exec rake test From d99cd660e708a5c071b6e019cce264b7a73135bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:30:24 +0200 Subject: [PATCH 09/21] =?UTF-8?q?=E2=9A=97=EF=B8=8F=20Add=20debug=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rakefile b/Rakefile index ce940d2..587a14f 100644 --- a/Rakefile +++ b/Rakefile @@ -18,6 +18,8 @@ task "test" do File.open("_site/feed.json", "r") do |f| json = f.read + puts "Debug feed.json: #{json}" + if valid_json?(json) puts "feed.json is valid" else From eee463f46c35776ddbdc173c5bb6c0368813e7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:38:24 +0200 Subject: [PATCH 10/21] =?UTF-8?q?=E2=9C=85=20Update=20test=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rakefile | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Rakefile b/Rakefile index 587a14f..3a4f4c5 100644 --- a/Rakefile +++ b/Rakefile @@ -7,24 +7,16 @@ task "default" => [:test] desc "Runs the tests!" task "test" do - def valid_json?(json) - JSON.parse(json) - true - rescue JSON::ParserError, TypeError => e - false - end - - # test if _site/feed.json is valid - File.open("_site/feed.json", "r") do |f| - json = f.read - - puts "Debug feed.json: #{json}" + begin + # test if _site/feed.json is valid + File.open("_site/feed.json", "r") do |f| + json = f.read - if valid_json?(json) - puts "feed.json is valid" - else - puts "feed.json is not valid" - exit 1 + puts "Debug feed.json: #{json}" + JSON.parse(json) end + rescue StandardError => e + puts e.inspect + exit 1 end end From 0712f1c026bc3d5ef2837b598483139588a917c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:46:29 +0200 Subject: [PATCH 11/21] =?UTF-8?q?=F0=9F=93=8C=20Pin=20actions=20to=20SHA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f79cbd4..2d48b56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac - name: Configure Pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 - name: Build Pages uses: actions/jekyll-build-pages@v1 From cf65a3aa8eac00f86805dac869b28a57e571a153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:46:46 +0200 Subject: [PATCH 12/21] =?UTF-8?q?=E2=9C=85=20Remove=20not=20needed=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d48b56..6dbad27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,11 +31,5 @@ jobs: with: bundler-cache: true - - name: Check Cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 - with: - path: _site - key: feed-ci-jekyll-${{ hashFiles('**/_site/feed.json') }} - - name: Run tests run: bundle exec rake test From 11fb6c3e4e0db9c092b51f572b1efc3272bbba70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:49:47 +0200 Subject: [PATCH 13/21] =?UTF-8?q?=E2=9C=85=20Add=20exit=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and disable debug output --- Rakefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 3a4f4c5..f2f6003 100644 --- a/Rakefile +++ b/Rakefile @@ -12,11 +12,14 @@ task "test" do File.open("_site/feed.json", "r") do |f| json = f.read - puts "Debug feed.json: #{json}" + # puts "Debug feed.json: #{json}" JSON.parse(json) end + + exit 0 rescue StandardError => e puts e.inspect + exit 1 end end From 60a20f2314efcf5cbd980002dcf9f2465479441b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 12:52:34 +0200 Subject: [PATCH 14/21] =?UTF-8?q?=F0=9F=90=9B=20Delete=20breaking=20`,`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feed.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feed.json b/feed.json index 050b94b..bf243b0 100644 --- a/feed.json +++ b/feed.json @@ -15,7 +15,7 @@ permalink: feed.json "content": {{ post.content | jsonify }}, "parameterized_name": {{ post.parameterized_name | jsonify }}, "date_published": "{{ post.date | date_to_xmlschema }}", - "delivery": {{ post.delivery | jsonify }}, + "delivery": {{ post.delivery | jsonify }} } {% unless forloop.last %},{% endunless %}{% endfor %} ] From 5e535fffe3950cdfce2cfbbe8a85884ffb486b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20St=C3=B6lzle?= Date: Tue, 19 Sep 2023 14:00:40 +0200 Subject: [PATCH 15/21] Apply suggestions from code review Co-authored-by: Igwe Kalu --- Gemfile | 1 + Rakefile | 44 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index dccde83..d2a7d8b 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,5 @@ gem 'jekyll-octicons', '17.8.0' group :test do gem "rake" + gem "json-schema", "~> 2.4.1" end diff --git a/Rakefile b/Rakefile index f2f6003..3406f3e 100644 --- a/Rakefile +++ b/Rakefile @@ -2,6 +2,7 @@ # frozen_string_literal: true require "json" +require "json-schema" task "default" => [:test] desc "Runs the tests!" @@ -11,15 +12,56 @@ task "test" do # test if _site/feed.json is valid File.open("_site/feed.json", "r") do |f| json = f.read + # puts "Debug feed.json: #{json}" - JSON.parse(json) + es_offerings_site_feed = JSON.parse(json) + + # validate the site feed + es_offerings_site_feed_schema = { + "type" => "object", + "required" => ["version", "title", "feed_url", "expired", "items"], + "properties" => { + "version" => { "type" => "string" }, + "title" => { "type" => "string" }, + "feed_url" => { "type" => "string" }, + "expired" => { "type" => "bool" }, + "items" => { + "type" => "array", + "required" => true, + "items" => [{ + "type" => "object", + "required" => ["layout", "title", "delivery", "description", "parameterized_name"], + "properties" => { + "layout" => { "type" => "string" }, + "title" => { "type" => "string" }, + "delivery" => { + "type" => "object", + "required" => ["method", "unit"], + "properties" => { + "method" => { "type" => "string" }, + "unit" => { "type" => "string" } + } + }, + "description" => { "type" => "string" }, + "parameterized_name" => { "type" => "string" }, + } + }] + } + } + } + + JSON::Validator.validate(es_offerings_site_feed_schema, es_offerings_site_feed) end exit 0 rescue StandardError => e puts e.inspect + exit 1 + rescue JSON::Schema::ValidationError + puts $!.message + exit 1 end end From 529efc9a4e32c2d405aad980771cedb89eb75a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 14:29:50 +0200 Subject: [PATCH 16/21] =?UTF-8?q?=E2=9E=95=20Add=20json-schema=20gem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d2a7d8b..24cdd0a 100644 --- a/Gemfile +++ b/Gemfile @@ -6,5 +6,5 @@ gem 'jekyll-octicons', '17.8.0' group :test do gem "rake" - gem "json-schema", "~> 2.4.1" + gem "json-schema" end From c7053e87a3ff488cef773b7bf104722944b00995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Tue, 19 Sep 2023 14:37:53 +0200 Subject: [PATCH 17/21] =?UTF-8?q?=F0=9F=92=9A=20Add=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dbad27..61db89c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,20 @@ jobs: - name: Checkout uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac + - name: Cache + id: cache + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 + with: + path: _site + key: feed-ci-jekyll-${{ hashFiles('_offerings/**/*.md') }}-${{ hashFiles('feed.json') }} + - name: Configure Pages uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 + if: steps.cache.outputs.cache-hit != 'true' - name: Build Pages uses: actions/jekyll-build-pages@v1 + if: steps.cache.outputs.cache-hit != 'true' - name: Setup Ruby uses: ruby/setup-ruby@5311f05890856149502132d25c4a24985a00d426 From be06c500bd1826d0df3ec57fcefc06cfd2f6a0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20St=C3=B6lzle?= Date: Tue, 19 Sep 2023 16:15:48 +0200 Subject: [PATCH 18/21] Update Rakefile Co-authored-by: Igwe Kalu --- Rakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 3406f3e..fb80fc8 100644 --- a/Rakefile +++ b/Rakefile @@ -55,8 +55,8 @@ task "test" do end exit 0 - rescue StandardError => e - puts e.inspect + rescue Errno::ENOENT => e + puts "_site/feed.json was not found" exit 1 rescue JSON::Schema::ValidationError From 41a24ad1d27cbdfde1965039e9edf3f027ac8c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Wed, 20 Sep 2023 08:49:38 +0200 Subject: [PATCH 19/21] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20JSON=20sc?= =?UTF-8?q?hema=20validation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rakefile | 84 ++++++++++++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/Rakefile b/Rakefile index fb80fc8..8b5ef83 100644 --- a/Rakefile +++ b/Rakefile @@ -8,59 +8,53 @@ task "default" => [:test] desc "Runs the tests!" task "test" do - begin - # test if _site/feed.json is valid - File.open("_site/feed.json", "r") do |f| - json = f.read - - - # puts "Debug feed.json: #{json}" - es_offerings_site_feed = JSON.parse(json) - - # validate the site feed - es_offerings_site_feed_schema = { - "type" => "object", - "required" => ["version", "title", "feed_url", "expired", "items"], - "properties" => { - "version" => { "type" => "string" }, - "title" => { "type" => "string" }, - "feed_url" => { "type" => "string" }, - "expired" => { "type" => "bool" }, - "items" => { - "type" => "array", - "required" => true, - "items" => [{ - "type" => "object", - "required" => ["layout", "title", "delivery", "description", "parameterized_name"], + # schema definition for _site/feed.json + es_offerings_site_feed_schema = { + "type" => "object", + "required" => ["version", "title", "feed_url", "expired", "items"], + "properties" => { + "version" => { "type" => "string" }, + "title" => { "type" => "string" }, + "feed_url" => { "type" => "string" }, + "expired" => { "type" => "bool" }, + "items" => { + "type" => "array", + "required" => true, + "items" => [{ + "type" => "object", + "required" => ["title", "lead", "content", "parameterized_name", "date_published"], + "properties" => { + "title" => { "type" => "string" }, + "lead" => { "type" => "string" }, + "content" => { "type" => "string" }, + "parameterized_name" => { "type" => "string" }, + "date_published" => { "type" => "string" }, + "delivery" => { + "type" => ["object", "null"], + "required" => ["method", "unit"], "properties" => { - "layout" => { "type" => "string" }, - "title" => { "type" => "string" }, - "delivery" => { - "type" => "object", - "required" => ["method", "unit"], - "properties" => { - "method" => { "type" => "string" }, - "unit" => { "type" => "string" } - } - }, - "description" => { "type" => "string" }, - "parameterized_name" => { "type" => "string" }, + "method" => { "type" => "string" }, + "unit" => { "type" => "string" } } - }] + }, } - } + }] } - - JSON::Validator.validate(es_offerings_site_feed_schema, es_offerings_site_feed) - end + } + } + + begin + raise "_site/feed.json was not found" unless File.exist?("_site/feed.json") + + JSON::Validator.validate!(es_offerings_site_feed_schema, "_site/feed.json") exit 0 - rescue Errno::ENOENT => e - puts "_site/feed.json was not found" + rescue JSON::Schema::ValidationError => e + puts e.message exit 1 - rescue JSON::Schema::ValidationError - puts $!.message + rescue StandardError => e + puts e.message exit 1 end From c1cec20155951bdc56310294bd6241f689969ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Wed, 20 Sep 2023 08:52:31 +0200 Subject: [PATCH 20/21] =?UTF-8?q?=F0=9F=93=8C=20Pin=20actions=20to=20SHA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61db89c..d6ce6a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' - name: Build Pages - uses: actions/jekyll-build-pages@v1 + uses: actions/jekyll-build-pages@058068233b22675635bdf8dfa178d6ae77f12694 if: steps.cache.outputs.cache-hit != 'true' - name: Setup Ruby From 6282769261950928da3e4a7a57fb04f7666c99d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sto=CC=88lzle?= Date: Wed, 20 Sep 2023 08:55:22 +0200 Subject: [PATCH 21/21] =?UTF-8?q?=F0=9F=92=9A=20Rename=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6ce6a0..3ec18db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,11 @@ permissions: concurrency: # allow only one run per branch and event - group: ci-${{ github.ref }}-${{ github.event_name }} + group: feed-ci-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true jobs: - ci: + feed-ci: runs-on: ubuntu-latest steps: