Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: folio-org/mod-search
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.6
Choose a base ref
...
head repository: folio-org/mod-search
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 934 changed files with 37,332 additions and 11,084 deletions.
8 changes: 7 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -3,8 +3,14 @@ updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: daily
interval: "weekly"
day: "sunday"
commit-message:
prefix: fix
prefix-development: chore
include: scope
groups:
dev-deps:
dependency-type: "development"
prod-deps:
dependency-type: "production"
16 changes: 14 additions & 2 deletions .github/workflows/api-doc.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,8 @@ name: api-doc

env:
API_TYPES: 'OAS'
API_DIRECTORIES: 'src/main/resources/swagger.api'
API_DIRECTORIES: 'target/api/openapi'
API_INPUT_SPEC: 'src/main/resources/swagger.api/mod-search.yaml'
API_EXCLUDES: ''
OUTPUT_DIR: 'folio-api-docs'
AWS_S3_BUCKET: 'foliodocs'
@@ -28,6 +29,7 @@ env:
AWS_S3_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}

on:
workflow_dispatch:
push:
branches: [ main, master ]
paths:
@@ -43,6 +45,14 @@ jobs:
with:
ref: ${{ github.REF }}
submodules: recursive
- name: Build spec
uses: s4u/setup-maven-action@v1.12.0
- run: |
mvn openapi-generator:generate \
-Dopenapi.generator.maven.plugin.inputSpec=${{ env.API_INPUT_SPEC }} \
-Dopenapi.generator.maven.plugin.generatorName=openapi-yaml \
-Dopenapi.generator.maven.plugin.output=target/api \
-Dopenapi.generator.maven.plugin.additionalProperties=outputFile=openapi/mod-search.yaml
- name: Prepare folio-tools
run: |
git clone https://github.com/folio-org/folio-tools
@@ -77,6 +87,9 @@ jobs:
- name: Show generated files
working-directory: ${{ env.OUTPUT_DIR }}
run: ls -R
- name: Fix dead link
run: jq '.config.oas.files[] |= if . == "${{ env.API_DIRECTORIES }}/mod-search.yaml" then "${{ env.API_INPUT_SPEC }}" else . end' **/config-doc.json > tmp.json && mv tmp.json **/config-doc.json
working-directory: ${{ env.OUTPUT_DIR }}
- name: Publish to AWS S3
uses: sai-sharan/aws-s3-sync-action@v0.1.0
with:
@@ -88,4 +101,3 @@ jobs:
destination_prefix: ${{ env.AWS_S3_FOLDER }}
delete: false
quiet: false

9 changes: 2 additions & 7 deletions .github/workflows/api-lint.yml
Original file line number Diff line number Diff line change
@@ -23,16 +23,11 @@ name: api-lint
env:
API_TYPES: 'OAS'
API_DIRECTORIES: 'src/main/resources/swagger.api'
API_EXCLUDES: ''
API_EXCLUDES: 'paths responses'
API_WARNINGS: false

on:
push:
paths:
- 'src/main/resources/swagger.api/**'
pull_request:
paths:
- 'src/main/resources/swagger.api/**'
workflow_dispatch:

jobs:
api-lint:
7 changes: 1 addition & 6 deletions .github/workflows/api-schema-lint.yml
Original file line number Diff line number Diff line change
@@ -17,12 +17,7 @@ env:
API_EXCLUDES: ''

on:
push:
paths:
- 'src/main/resources/swagger.api/**'
pull_request:
paths:
- 'src/main/resources/swagger.api/**'
workflow_dispatch:

jobs:
api-schema-lint:
26 changes: 9 additions & 17 deletions .github/workflows/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -2,26 +2,18 @@ name: elasticsearch

on:
workflow_dispatch:
push:
branches: [ master ]

jobs:
elasticsearch7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- run: export SEARCH_ENGINE_DOCKERFILE="docker/elasticsearch/Dockerfile"; mvn clean install
elasticsearch8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- run: export SEARCH_ENGINE_DOCKERFILE="docker/elasticsearch8/Dockerfile"; mvn clean install
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- run: export SEARCH_ENGINE_DOCKERFILE="docker/elasticsearch8/Dockerfile"; mvn clean install

22 changes: 22 additions & 0 deletions .github/workflows/spectral-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Spectral on Pull Requests

on:
push:
paths:
- 'src/main/resources/swagger.api/**'
pull_request:
paths:
- 'src/main/resources/swagger.api/**'

jobs:
build:
name: Run Spectral
runs-on: ubuntu-latest
steps:
# Check out the repository
- uses: actions/checkout@v3

# Run Spectral
- uses: stoplightio/spectral-action@latest
with:
file_glob: 'src/main/resources/swagger.api/*.yaml'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ target/
!**/src/test/**/target/
bin/
.checkstyle
.jpb

### STS ###
.apt_generated
@@ -36,3 +37,4 @@ build/

### Development
application-local.yml
!/.jpb/
157 changes: 157 additions & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
extends: [ "spectral:oas" ]
aliases:
PathItem:
description: ''
targets:
- formats:
- oas2
given:
- "$.paths[*]"
- formats:
- oas3
given:
- "$.paths[*]"
OperationObject:
description: 'The complete operation object. Use it in combo with field object.'
targets:
- formats:
- oas2
given:
- "#PathItem[get,put,post,delete,options,head,patch,trace]"
- formats:
- oas3
given:
- "#PathItem[get,put,post,delete,options,head,patch,trace]"
DescribableObjects:
description: ''
targets:
- formats:
- oas2
given:
- "$.info"
- "$.tags[*]"
- "#OperationObject"
- "$.paths[*][*].responses[*]"
- "$..parameters[?(@ && @.in)]"
- "$.definitions[*]"
- formats:
- oas3
given:
- "$.info"
- "$.tags[*]"
- "#OperationObject"
- "$.paths[*][*].responses[*]"
- "$..parameters[?(@ && @.in)]"
- "$.components.schemas[*]"
- "$.servers[*]"
MediaTypeObjects:
description: ''
targets:
- formats:
- oas2
given:
- $.paths[*][*]..parameters[?(@ && @.in == "body")]
- "$.paths[*][*].responses[*]"
- formats:
- oas3
given:
- "$.paths[*][*].requestBody.content[*]"
- "$.paths[*][*].responses[*].content[*]"
rules:
docs-descriptions:
given:
- "#DescribableObjects"
severity: warn
then:
- function: truthy
field: description
- function: length
functionOptions:
min: 10
field: description
- function: pattern
functionOptions:
match: "/^[A-Z]/"
field: description
description: "Descriptions should be provided for describable objects, such as `info`, `tags`, `operations`, `parameters`, and more."
message: "{{error}}."
docs-info-contact:
given:
- "$"
severity: warn
then:
function: truthy
field: info.contact
description: "`Info` object should include contact information."
docs-parameters-examples-or-schema:
given:
- "$.paths.parameters[*]"
severity: info
then:
function: schema
functionOptions:
schema:
type: object
anyOf:
- required:
- examples
- required:
- schema
description: "Path parameter must contain a defined schema or examples."
message: No example or schema provided for {{property}}
formats:
- oas3
docs-summary:
given:
- "#PathItem[*]"
severity: error
then:
- function: truthy
field: summary
description: "Path parameter must contain a defined schema or examples."
message: No summary provided for {{property}}
formats:
- oas3
docs-media-types-examples-or-schema:
given:
- "#MediaTypeObjects"
severity: info
then:
function: schema
functionOptions:
schema:
type: object
anyOf:
- required:
- examples
- required:
- schema
description: "Media object must contain a defined schema or examples."
message: No example or schema provided for {{property}}
formats:
- oas3
docs-tags-alphabetical:
given:
- "$"
severity: warn
then:
function: alphabetical
functionOptions:
keyedBy: name
field: tags
description: "Tags are not in alphabetical order."
message: Tags should be defined in alphabetical order
docs-operation-tags:
given:
- "#OperationObject"
severity: warn
then:
function: schema
functionOptions:
schema:
type: array
minItems: 1
field: tags
description: "Operation must have at least one tag."
message: Operation should have non-empty `tags` array.

42 changes: 39 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
# Contribution guidelines
# Contributing to FOLIO mod-search

Guidelines for Contributing Code:
[dev.folio.org/guidelines/contributing](https://dev.folio.org/guidelines/contributing)
Thank you for considering contributing to FOLIO mod-search! Your contributions are valuable and help us improve the project. Please take a moment to review this guide before making your contribution.

## Table of Contents

<!-- TOC -->
* [Contributing to FOLIO mod-search](#contributing-to-folio-mod-search)
* [Table of Contents](#table-of-contents)
* [How to Contribute](#how-to-contribute)
* [Reporting Issues](#reporting-issues)
* [Submitting Changes](#submitting-changes)
<!-- TOC -->

## How to Contribute

### Reporting Issues

If you encounter bugs, issues, or have any suggestions for improvements, please open an issue on [JIRA mod-search project](https://folio-org.atlassian.net/browse/MSEARCH). Provide as much detail as possible to help us understand and address the problem.

1. **Search for existing issues**: Before creating a new issue, please check if the issue has already been reported.
2. **Create a new issue**: If the issue does not exist, create a new issue using the provided template. Include a clear and descriptive title, a detailed description, steps to reproduce the issue, and any other relevant information.

### Submitting Changes

1. **Create a Branch**: Create a new branch for your changes.
```bash
git checkout -b your-branch-name
```
2. **Make Changes**: Make your changes in your branch.
3. **Commit Changes**: Commit your changes with a meaningful commit message that will follow [Conventional Commit practice](https://folio-org.atlassian.net/wiki/spaces/FOLIJET/pages/1400654/Conventional+Commit+Initiative) .
```bash
git add .
git commit -m "Your commit message"
```
4. **Push Changes**: Push your changes to the repository.
```bash
git push origin your-branch-name
```
5. **Create a Pull Request**: Open a pull request from your branch to the `master` branch of the original repository. Follow [Pull Request Template](PULL_REQUEST_TEMPLATE.md) to create a description.
Loading