Skip to content

Commit

Permalink
Search: Create a new search package, rename Search plugin (#21502)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnmoon authored and anomiex committed Oct 25, 2021
0 parents commit 95bbe6a
Show file tree
Hide file tree
Showing 10 changed files with 555 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Files not needed to be distributed.
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore
phpunit.xml.dist export-ignore
tests/ export-ignore

# Files not needed in the production build.
/changelog/** production-exclude
42 changes: 42 additions & 0 deletions .github/workflows/autotagger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Auto-tagger

on:
push:
branches: [ 'master' ]

jobs:
tag:
name: Tag
runs-on: ubuntu-latest
steps:
- name: Check that the secret is set
env:
TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
run: |
if [[ -z "$TOKEN" ]]; then
echo '::error::The secret API_TOKEN_GITHUB must be set.'
exit 1
fi
- uses: actions/checkout@v2
with:
# We want to potentially trigger "tag" events, but the default GITHUB_TOKEN
# explicitly does not trigger events.
token: ${{ secrets.API_TOKEN_GITHUB }}

- name: Tag
run: |
VER=$(sed -nEe 's/^## \[?([^]]*)\]? - .*/\1/;T;p;q' CHANGELOG.md || true)
echo "Version from changelog is ${VER:-<unknown>}"
if [[ "$VER" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then
export GIT_AUTHOR_NAME=matticbot
export [email protected]
export GIT_COMMITTER_NAME=matticbot
export [email protected]
git tag "v$VER"
git push origin "v$VER"
if [[ -e composer.json ]] && jq -e '.extra.autotagger.major?' composer.json >/dev/null; then
git tag --force "v${VER%%.*}"
git push --force origin "v${VER%%.*}"
fi
fi
25 changes: 25 additions & 0 deletions .github/workflows/readonly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Enforce read-only repo status

on:
issues:
types: opened
pull_request_target:
types: opened

jobs:
lockdown:
runs-on: ubuntu-latest
steps:
- uses: dessant/repo-lockdown@v2
with:
github-token: ${{ github.token }}
issue-comment: |
Thank you for your interest!
Issues should be filed at https://github.com/Automattic/jetpack/issues. Be sure to mention the product that the issue is regarding.
skip-closed-issue-comment: true
pr-comment: |
Thank you for your interest!
Pull requests should be made against the monorepo at https://github.com/Automattic/jetpack.
skip-closed-pr-comment: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wordpress
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.1.0-alpha - unreleased

This is an alpha version! The changes listed here are not final.

### Added
- Add a new Search package with Helper and Options classes.
357 changes: 357 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Security Policy

Full details of the Automattic Security Policy can be found on [automattic.com](https://automattic.com/security/).

## Supported Versions

Generally, only the latest version of Jetpack has continued support. If a critical vulnerability is found in the current version of Jetpack, we may opt to backport any patches to previous versions.

## Reporting a Vulnerability

[Jetpack](https://jetpack.com/) is an open-source plugin for WordPress. Our HackerOne program covers the plugin software, as well as a variety of related projects and infrastructure.

**For responsible disclosure of security issues and to be eligible for our bug bounty program, please submit your report via the [HackerOne](https://hackerone.com/automattic) portal.**

Our most critical targets are:

* Jetpack and the Jetpack composer packages (all within this repo)
* Jetpack.com -- the primary marketing site.
* cloud.jetpack.com -- a management site.
* wordpress.com -- the shared management site for both Jetpack and WordPress.com sites.

For more targets, see the `In Scope` section on [HackerOne](https://hackerone.com/automattic).

_Please note that the **WordPress software is a separate entity** from Automattic. Please report vulnerabilities for WordPress through [the WordPress Foundation's HackerOne page](https://hackerone.com/wordpress)._

## Guidelines

We're committed to working with security researchers to resolve the vulnerabilities they discover. You can help us by following these guidelines:

* Follow [HackerOne's disclosure guidelines](https://www.hackerone.com/disclosure-guidelines).
* Pen-testing Production:
* Please **setup a local environment** instead whenever possible. Most of our code is open source (see above).
* If that's not possible, **limit any data access/modification** to the bare minimum necessary to reproduce a PoC.
* **_Don't_ automate form submissions!** That's very annoying for us, because it adds extra work for the volunteers who manage those systems, and reduces the signal/noise ratio in our communication channels.
* To be eligible for a bounty, all of these guidelines must be followed.
* Be Patient - Give us a reasonable time to correct the issue before you disclose the vulnerability.

We also expect you to comply with all applicable laws. You're responsible to pay any taxes associated with your bounties.
43 changes: 43 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "automattic/jetpack-search",
"description": "Tools to assist with enabling cloud search for Jetpack sites.",
"type": "library",
"license": "GPL-2.0-or-later",
"require": {},
"require-dev": {
"automattic/jetpack-changelogger": "^3.0",
"yoast/phpunit-polyfills": "1.0.1"
},
"autoload": {
"classmap": [
"src/"
]
},
"scripts": {
"phpunit": [
"./vendor/phpunit/phpunit/phpunit --colors=always"
],
"test-coverage": [
"@composer install",
"phpdbg -d memory_limit=2048M -d max_execution_time=900 -qrr ./vendor/bin/phpunit --coverage-clover \"$COVERAGE_DIR/clover.xml\""
],
"test-php": [
"@composer install",
"@composer phpunit"
],
"post-update-cmd": "php -r \"copy('vendor/automattic/wordbless/src/dbless-wpdb.php', 'wordpress/wp-content/db.php');\""
},
"repositories": [],
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"autotagger": true,
"mirror-repo": "Automattic/jetpack-search",
"changelogger": {
"link-template": "https://github.com/Automattic/jetpack-search/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-master": "0.1.x-dev"
}
}
}
16 changes: 16 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<phpunit bootstrap="tests/php/bootstrap.php" backupGlobals="false" colors="true">
<testsuites>
<testsuite name="main">
<directory prefix="test" suffix=".php">tests/php</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">.</directory>
<exclude>
<directory suffix=".php">tests</directory>
<directory suffix=".php">vendor</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
11 changes: 11 additions & 0 deletions tests/php/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Initialize the testing environment.
*
* @package automattic/jetpack-backup
*/

/**
* Load the composer autoloader.
*/
require_once __DIR__ . '/../../vendor/autoload.php';

0 comments on commit 95bbe6a

Please sign in to comment.