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

chore(tooling): setup GitHub actions, add CODEOWNERS and PR template #20

Merged
merged 8 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODEOWNERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Default owners

- @algolia/data-ingestion
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## 🧭 What and Why

🎟 JIRA Ticket:

### Changes included:

- List changes

## 🧪 Test

- `yarn dev`
shortcuts marked this conversation as resolved.
Show resolved Hide resolved
43 changes: 43 additions & 0 deletions .github/workflows/client_javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: client_javascript

on: [push]

jobs:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job could depend on specs because it won't build with invalid spec.

Copy link
Member Author

@shortcuts shortcuts Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, apparently the workflow_run option is only triggered when deployed on the main branch, which seems odd 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I remember when I worked on Github Actions, there are a bunch of things that worked only on main and not on prs, this was quite an annoying limitation :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will see once this PR is merged and will fix if it's not the case!

build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: ['16']
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can add this whole part to a local GH action, will check 🤔


- name: Install Dependencies
run: yarn install

- name: Generate search client
run: yarn generate:js:search

- name: Build search client
run: yarn client:build-js:search

- name: Generate recommend client
run: yarn generate:js:recommend

- name: Build recommend client
run: yarn client:build-js:recommend

- name: Lint
run: yarn prettier --check clients/algoliasearch-client-javascript
37 changes: 37 additions & 0 deletions .github/workflows/specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: specs

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: ['16']
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

- name: Install Dependencies
run: yarn install

- name: Build
run: yarn build:spec

- name: Validate
run: yarn validate

- name: Lint
run: yarn prettier --check specs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ yarn-error.log
**/node_modules
**/dist
**/.openapi-generator-ignore
**/git_push.sh
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,26 @@
nvm use && yarn
```

## Generate clients based on the [`spec.yml` file](./search/specs.yml)
## Generate clients based on the [`specs`](./specs/)

### All clients

```bash
yarn generate
```

### Search client

```bash
yarn generate:search
```

### Recommend client

```bash
yarn generate:recommend
```

## Build generated clients

```bash
Expand Down
7 changes: 5 additions & 2 deletions clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ This folder hosts the generated clients and their utils.

## Generated clients

- [algoliasearch-client-javascript](./algoliasearch-client-javascript/): The Algolia JavaScript client.
### JavaScript

- [algoliasearch](./algoliasearch-client-javascript/algoliasearch/): The Algolia search client.
- [@algolia/recommend](./algoliasearch-client-javascript/recommend/): The Algolia recommend client.

## Utils

- [JavaScript](./utils/javascript/): The Algolia JavaScript utils.
- [JavaScript](./algoliasearch-client-javascript/utils/): The JavaScript clients utils.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This is the entrypoint for the package
export * from './client-search/apis';
export * from './src/apis';
export * from './model/models';
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export type BaseIndexSettings = {
/**
* Creates replicas, exact copies of an index.
*/
replicas?: Array<string>;
/**
* Set the maximum number of hits accessible via pagination.
*/
paginationLimitedTo?: number;
/**
* A list of words for which you want to turn off typo tolerance.
*/
disableTypoToleranceOnWords?: Array<string>;
/**
* Specify on which attributes to apply transliteration.
*/
attributesToTransliterate?: Array<string>;
/**
* List of attributes on which to do a decomposition of camel case words.
*/
camelCaseAttributes?: Array<string>;
/**
* Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding.
*/
decompoundedAttributes?: { [key: string]: object };
/**
* Sets the languages at the index level for language-specific processing such as tokenization and normalization.
*/
indexLanguages?: Array<string>;
/**
* Whether promoted results should match the filters of the current search, except for geographic filters.
*/
filterPromotes?: boolean;
/**
* List of attributes on which you want to disable prefix matching.
*/
disablePrefixOnAttributes?: Array<string>;
/**
* Enables compression of large integer arrays.
*/
allowCompressionOfIntegerArray?: boolean;
/**
* List of numeric attributes that can be used as numerical filters.
*/
numericAttributesForFiltering?: Array<string>;
/**
* Lets you store custom data in your indices.
*/
userData?: { [key: string]: object };
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
export type BaseSearchParams = {
/**
* The text to search in the index.
*/
query: string;
/**
* Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results.
*/
similarQuery?: string;
/**
* Filter the query with numeric, facet and/or tag filters.
*/
filters?: string;
/**
* Filter hits by facet value.
*/
facetFilters?: Array<string>;
/**
* Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter.
*/
optionalFilters?: Array<string>;
/**
* Filter on numeric attributes.
*/
numericFilters?: Array<string>;
/**
* Filter hits by tags.
*/
tagFilters?: Array<string>;
/**
* Determines how to calculate the total score for filtering.
*/
sumOrFiltersScores?: boolean;
/**
* Retrieve facets and their facet values.
*/
facets?: Array<string>;
/**
* Maximum number of facet values to return for each facet during a regular search.
*/
maxValuesPerFacet?: number;
/**
* Force faceting to be applied after de-duplication (via the Distinct setting).
*/
facetingAfterDistinct?: boolean;
/**
* Controls how facet values are fetched.
*/
sortFacetValuesBy?: string;
/**
* Specify the page to retrieve.
*/
page?: number;
/**
* Specify the offset of the first hit to return.
*/
offset?: number;
/**
* Set the number of hits to retrieve (used only with offset).
*/
length?: number;
/**
* Search for entries around a central geolocation, enabling a geo search within a circular area.
*/
aroundLatLng?: string;
/**
* Search for entries around a given location automatically computed from the requester’s IP address.
*/
aroundLatLngViaIP?: boolean;
/**
* Define the maximum radius for a geo search (in meters).
*/
aroundRadius?: number | string | null;
/**
* Precision of geo search (in meters), to add grouping by geo location to the ranking formula.
*/
aroundPrecision?: number;
/**
* Minimum radius (in meters) used for a geo search when aroundRadius is not set.
*/
minimumAroundRadius?: number;
/**
* Search inside a rectangular area (in geo coordinates).
*/
insideBoundingBox?: Array<number>;
/**
* Search inside a polygon (in geo coordinates).
*/
insidePolygon?: Array<number>;
/**
* This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search.
*/
naturalLanguages?: Array<string>;
/**
* Enables contextual rules.
*/
ruleContexts?: Array<string>;
/**
* Define the impact of the Personalization feature.
*/
personalizationImpact?: number;
/**
* Associates a certain user token with the current search.
*/
userToken?: string;
/**
* Retrieve detailed ranking information.
*/
getRankingInfo?: boolean;
/**
* Enable the Click Analytics feature.
*/
clickAnalytics?: boolean;
/**
* Whether the current query will be taken into account in the Analytics.
*/
analytics?: boolean;
/**
* List of tags to apply to the query for analytics purposes.
*/
analyticsTags?: Array<string>;
/**
* Whether to include or exclude a query from the processing-time percentile computation.
*/
percentileComputation?: boolean;
/**
* Whether this search should participate in running AB tests.
*/
enableABTest?: boolean;
/**
* Whether this search should use AI Re-Ranking.
*/
enableReRanking?: boolean;
};