Skip to content

Commit

Permalink
Merge branch 'main' into better-summary-oapi
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta authored Jun 17, 2024
2 parents 1d69cb8 + d97e9ac commit 84c09a4
Show file tree
Hide file tree
Showing 23 changed files with 137,362 additions and 136 deletions.
236 changes: 236 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,237 @@
### Header #########################################################################################

# The filename patterns in '.gitattributes' are case-sensitive!

### Line Endings ###################################################################################

# Set default behavior to automatically normalize line endings
* text=auto

# Force batch scripts to always use CRLF line endings
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf

# Force bash scripts to always use LF line endings
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf
*.zsh text eol=lf

# Text files where line endings should be preserved
*.patch -text

### Common #########################################################################################

# Configs
.editorconfig text
.gitattributes text export-ignore
.gitignore text export-ignore
.gitkeep text export-ignore
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text
*.cnf text
*.conf text
*.config text
*.ini text

# Documents
*.markdown text diff=markdown
*.md text diff=markdown
*.mdwn text diff=markdown
*.mdown text diff=markdown
*.mkd text diff=markdown
*.mkdn text diff=markdown
*.mdtxt text
*.mdtext text
*.txt text
*.tex text diff=tex
*.adoc text
*.textile text
*.mustache text
*.csv text eol=crlf
*.tab text
*.tsv text
*.sql text
*.epub diff=astextplain
*.bibtex text diff=bibtex
*.doc diff=astextplain
*.docx diff=astextplain
*.dot diff=astextplain
*.pdf diff=astextplain
*.rtf diff=astextplain

# Documentation
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text

# Graphics
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.gifv binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary

# Audio
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary

# Video
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.avi binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary

# Archives
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary

# Executables
*.exe binary
*.pyc binary

# Misc
Makefile text
Dockerfile text

### Web ############################################################################################

# Source code
*.coffee text
*.css text diff=css
*.htm text diff=html
*.html text diff=html
*.inc text
*.js text
*.mjs text
*.cjs text
*.jsx text
*.less text
*.ls text
*.map text -diff
*.od text
*.onlydata text
*.php text diff=php
*.pl text
*.py text diff=python
*.rb text diff=ruby
*.sass text
*.scm text
*.scss text diff=css
*.sh text eol=lf
.husky/* text eol=lf
*.styl text
*.tag text
*.ts text
*.tsx text
*.xml text
*.xhtml text diff=html

# Configs
.env text
.htaccess text
*.lock text -diff
package.json text eol=lf
package-lock.json text eol=lf -diff
pnpm-lock.yaml text eol=lf -diff
.prettierrc text
yarn.lock text -diff
browserslist text
# Fixes syntax highlighting on GitHub to allow comments
tsconfig.json linguist-language=JSON-with-Comments

# Templates
*.dot text
*.ejs text
*.erb text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.svelte text
*.tmpl text
*.tpl text
*.twig text
*.vue text

# Fonts
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary

# RC files (like .babelrc or .eslintrc)
*.*rc text

# Ignore files (like .npmignore or .gitignore)
*.*ignore text

# Prevents massive diffs from built files
dist/* binary

### Linguist Overrides #############################################################################

output/dangling-types/dangling.csv linguist-generated=true
output/schema/schema.json linguist-generated=true
output/openapi/elasticsearch-serverless-openapi.json linguist-generated=true
Expand All @@ -6,3 +240,5 @@ output/schema/import-namespace-graph-compact.json linguist-generated=true
output/schema/import-namespace-graph-expanded.json linguist-generated=true
output/schema/validation-errors.json linguist-generated=true
output/typescript/types.ts linguist-generated=true

####################################################################################################
28 changes: 15 additions & 13 deletions .github/validate-pr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,22 @@ async function run () {
return 0
})

let comment = `Following you can find the validation results for the API${table.length === 1 ? '' : 's'} you have changed.\n\n`
comment += '| API | Status | Request | Response |\n'
comment += '| --- | --- | --- | --- |\n'
for (const line of [...new Set(table)]) {
comment += line
}
comment += `\nYou can validate ${table.length === 1 ? 'this' : 'these'} API${table.length === 1 ? '' : 's'} yourself by using the ${tick}make validate${tick} target.\n`
if (table.length > 0) {
let comment = `Following you can find the validation results for the API${table.length === 1 ? '' : 's'} you have changed.\n\n`
comment += '| API | Status | Request | Response |\n'
comment += '| --- | --- | --- | --- |\n'
for (const line of [...new Set(table)]) {
comment += line
}
comment += `\nYou can validate ${table.length === 1 ? 'this' : 'these'} API${table.length === 1 ? '' : 's'} yourself by using the ${tick}make validate${tick} target.\n`

await octokit.rest.issues.createComment({
owner: 'elastic',
repo: 'elasticsearch-specification',
issue_number: context.payload.pull_request.number,
body: comment
})
await octokit.rest.issues.createComment({
owner: 'elastic',
repo: 'elasticsearch-specification',
issue_number: context.payload.pull_request.number,
body: comment
})
}

core.info('Done!')
}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
make compile
make generate
make transform-to-openapi
make filter-for-serverless
- name: Check for Changed Files
id: changes
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ name: Validate APIs

on:
pull_request:
paths:
- 'specification/**'
- '!specification/_types/**'
- '!specification/_spec_utils/**'
- '!specification/_doc_ids/**'
- '!specification/_json_spec/**'

branches:
- main

Expand Down Expand Up @@ -51,6 +44,11 @@ jobs:
npm install --prefix .github/validate-pr
make setup
- name: Generate specification and check generated types
working-directory: ./elasticsearch-specification
run: |
make generate
- name: Download artifacts
working-directory: ./clients-flight-recorder
run: |
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ transform-expand-generics: ## Create a new schema with all generics expanded
transform-to-openapi: ## Generate the OpenAPI definition from the compiled schema
@npm run transform-to-openapi --prefix compiler

filter-for-serverless: ## Generate the serverless version from the compiled schema
@npm run --prefix compiler filter-by-availability -- --serverless --visibility=public --input ../output/schema/schema.json --output ../output/schema/schema-serverless.json

dump-routes: ## Create a new schema with all generics expanded
@npm run dump-routes --prefix compiler

Expand Down
Loading

0 comments on commit 84c09a4

Please sign in to comment.