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 .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
hypothesis/h
40a/h
AFDudley/h
BigBlueHat/h
BinaryStars/h
CCH543/h
Cinemacloud/h
Ericgood/h
FTG-003/h
Forethinker/h
GratefulTony/h
HGldJ1966/h
JJediny/h
John-Williams/h
Laurian/h
LittleFancy/h
MattyQ/h
Mishkin2015/h
RichardLitt/h
Staffan1/h
SteelWagstaff/h
TowerBR/h
VanyTang/h
abigailricarte/h
ackermann/h
alecchap/h
alesarrett/h
alexsegura/h
almereyda/h
alon/h
andzi/h
angelicxsoul/h
ansmoh/h
apurvajalit/h
arjunvasan/h
asdevor/h
bZichett/h
badgettrg/Webmarks
balmas/h
balupton/h
bbarker/h
bennlich/h
benthor/h
blakewest/h
bogste/h
bradparks/h
brittanystoroz/h
buiquangchien/h
cdchapman/h
charblanc/h
chowsamihq/h
chr7stos/Webmarks
chrber/h
chrismPssina/h
christinaphamAD/h
cmbirk/h
codeaudit/h
coolcool21/h
cove/h
csillag/h
danjimilk/h
dannyhope/h
daredream/h
davidmcclure/h
dennisplucinik/h
dezynetechnologies/h
diegodlh/h
djcun95/h
donsequitur/h
edsu/h
eiro10/h
emckean/h
ercchy/h
eshellman/h
fangang123/h
fchasen/h
fcrimins/h
fhirsch/h
ficolo/h
fragkopoulos/h
gauravkeerthi/h
geass/h
gergely-ujvari/h
gitter-badger/h
gnott/h
gobengo/h
gorinovic/h
gus3000/h
hashin/h
helemaalbigt/h
hmstepanek/h
hwasiti/h
hylhero/h
hyperstudio/h
iHDeveloper/h
imeysam/h
jackspaceBerkeley/h
jarey/h
jasdeep/h
jason790/h
jasonzou/j
jazahn/h
jccr/h
jean/h
jeka57/h
jeremydean/h
jermnelson/h
jibe-b/h
jnishiyama/h
jojksd/h
jpadilla/h
jtremback/h
judell/h
juli-so/h
kabacs/h
karissa/h
kaushikvijay/h
kaydoh/h
kill4uk/h
klopiinas/h
klrkdekira/h
koulihong311/h
krassif/h
krstnkngs/h
leoqmp/h
linhua55/h
lucadealfaro/h
lyspooner/h
lyzadanger/h
m1yag1/h
magee/h
mambocab/h
manunymous/h
maraino/h
mari-ja/h
markbarratt/h
martinq/h
mbbaig/h
mcarv63/h
meawoppl/h
meflyup/h
metasj/h
mgasner/h
mgax/h
mollycr/h
mrchrisadams/h
mrienstra/h
mshavlovsky/h
muddasani/h
nagyist/hyphothesis-h
nagyistoce/hypothesis-h
nanxio/h
neozhangthe1/h
ningyifan/h
nkingsley/h
nlholdem/h
nlisgo/h
noscripter/h
nshkuro/h
odnodn/h
oliversauter/h
openbizgit/h
opengovfoundation/h
openstax/hypothesis-server
ouroboros8/h
pablomarti/h
pamo/h
philipn/h
philschatz/h
pinballwonder/h
plainspace/h
raowl/h
rickyhan/h
rmoorman/h
rmtsukuru/h
robertknight/h
rowhit/h
rsarxiv/h
saakaifoundry/h
samrose/h
scharf/h
shepazu/h
sherah/h
shofheinz/h
soapdog/h
ssin122/test-h
st-fresh/h
stuk88/h
sylvanmist/h
tetratorus/h
tilgovi/h
tomnar/h
trivenews/h
truthadjustr/h
utngz/h
voidfiles/h
wenchen/h
yargevad/h
yumatch/h
zshen777/h
Nothing to show
Choose a Head Repository
hypothesis/h
40a/h
AFDudley/h
BigBlueHat/h
BinaryStars/h
CCH543/h
Cinemacloud/h
Ericgood/h
FTG-003/h
Forethinker/h
GratefulTony/h
HGldJ1966/h
JJediny/h
John-Williams/h
Laurian/h
LittleFancy/h
MattyQ/h
Mishkin2015/h
RichardLitt/h
Staffan1/h
SteelWagstaff/h
TowerBR/h
VanyTang/h
abigailricarte/h
ackermann/h
alecchap/h
alesarrett/h
alexsegura/h
almereyda/h
alon/h
andzi/h
angelicxsoul/h
ansmoh/h
apurvajalit/h
arjunvasan/h
asdevor/h
bZichett/h
badgettrg/Webmarks
balmas/h
balupton/h
bbarker/h
bennlich/h
benthor/h
blakewest/h
bogste/h
bradparks/h
brittanystoroz/h
buiquangchien/h
cdchapman/h
charblanc/h
chowsamihq/h
chr7stos/Webmarks
chrber/h
chrismPssina/h
christinaphamAD/h
cmbirk/h
codeaudit/h
coolcool21/h
cove/h
csillag/h
danjimilk/h
dannyhope/h
daredream/h
davidmcclure/h
dennisplucinik/h
dezynetechnologies/h
diegodlh/h
djcun95/h
donsequitur/h
edsu/h
eiro10/h
emckean/h
ercchy/h
eshellman/h
fangang123/h
fchasen/h
fcrimins/h
fhirsch/h
ficolo/h
fragkopoulos/h
gauravkeerthi/h
geass/h
gergely-ujvari/h
gitter-badger/h
gnott/h
gobengo/h
gorinovic/h
gus3000/h
hashin/h
helemaalbigt/h
hmstepanek/h
hwasiti/h
hylhero/h
hyperstudio/h
iHDeveloper/h
imeysam/h
jackspaceBerkeley/h
jarey/h
jasdeep/h
jason790/h
jasonzou/j
jazahn/h
jccr/h
jean/h
jeka57/h
jeremydean/h
jermnelson/h
jibe-b/h
jnishiyama/h
jojksd/h
jpadilla/h
jtremback/h
judell/h
juli-so/h
kabacs/h
karissa/h
kaushikvijay/h
kaydoh/h
kill4uk/h
klopiinas/h
klrkdekira/h
koulihong311/h
krassif/h
krstnkngs/h
leoqmp/h
linhua55/h
lucadealfaro/h
lyspooner/h
lyzadanger/h
m1yag1/h
magee/h
mambocab/h
manunymous/h
maraino/h
mari-ja/h
markbarratt/h
martinq/h
mbbaig/h
mcarv63/h
meawoppl/h
meflyup/h
metasj/h
mgasner/h
mgax/h
mollycr/h
mrchrisadams/h
mrienstra/h
mshavlovsky/h
muddasani/h
nagyist/hyphothesis-h
nagyistoce/hypothesis-h
nanxio/h
neozhangthe1/h
ningyifan/h
nkingsley/h
nlholdem/h
nlisgo/h
noscripter/h
nshkuro/h
odnodn/h
oliversauter/h
openbizgit/h
opengovfoundation/h
openstax/hypothesis-server
ouroboros8/h
pablomarti/h
pamo/h
philipn/h
philschatz/h
pinballwonder/h
plainspace/h
raowl/h
rickyhan/h
rmoorman/h
rmtsukuru/h
robertknight/h
rowhit/h
rsarxiv/h
saakaifoundry/h
samrose/h
scharf/h
shepazu/h
sherah/h
shofheinz/h
soapdog/h
ssin122/test-h
st-fresh/h
stuk88/h
sylvanmist/h
tetratorus/h
tilgovi/h
tomnar/h
trivenews/h
truthadjustr/h
utngz/h
voidfiles/h
wenchen/h
yargevad/h
yumatch/h
zshen777/h
Nothing to show
This comparison is big! We’re only showing the most recent 250 commits
Commits on Aug 13, 2018
Commits on Aug 14, 2018
Merge pull request #5217 from hypothesis/update-es-version-in-install…
…-docs

Update Elasticsearch version and URL in installation docs
Commits on Aug 17, 2018
Commits on Aug 21, 2018
Make "gulp watch" task work with Gulp v4
 - The various "watch-*" tasks never complete, so they must be composed
   using `gulp.parallel` rather than `gulp.series`. Otherwise only the
   first one runs.

 - Adapt usage of `gulp.watch` in various "watch-*" tasks to pass a function as
   the argument instead of a task name as required by the Gulp v4 API [1].

 - Fix an existing issue where the "watch-css" task did not ensure that
   vendor CSS was built first.

   The issue mentioned in the existing comment about watching not
   working if the initial build failed appears not to apply any longer.

[1] https://github.com/gulpjs/gulp/blob/4.0/docs/API.md#gulpwatchglobs-opts-fn
Merge pull request #5222 from jmcarp/npm-audit-fix
Upgrade vulnerable deps with `npm audit fix`.
Commits on Aug 23, 2018
Merge pull request #5230 from hypothesis/admin-views-refactor
Reorganize admin views into `h.views.admin` module
Pipe compressed archive to `docker build` (#5233)
On my system (git 2.18.0 from Homebrew, docker 18.06.0-ce, macOS),
the "make docker" task was failing with the error:

```
git archive HEAD | docker build -t hypothesis/hypothesis:dev -
Sending build context to Docker daemon  4.487MB
Error response from daemon: Syntax error - can't find = in "paster.bootstrap(config,". Must be of the form: name=value
make: *** [docker] Error 1
```

The "docker build" documentation [1] states that the context should be
compressed, and sure enough configuring `git archive` to generate a
compressed archive resolves the issue.

[1] https://docs.docker.com/engine/reference/commandline/build/#build-with--
Commits on Aug 24, 2018
Remove an obsolete comment
Following the completion of the Elasticsearch 6 migration, these
functions are only called once each.
Port a test from h/search/old_index_test.py to h/search/index_test.py
Port across a useful test from the old search indexing tests that were
missing from the new tests to verify that the conversion from Annotation
to JSON document indexed in Elasticsearch uses the expected method.
Remove `# noqa: N806` from source code files
This is disabled globally.
Re-use `get` fixture in more tests
Code for fetching the indexed JSON document from Elasticsearch was
duplicated in several deletion and batch-indexing tests.

Reuse the existing `get` fixture for this purpose, but rename it to
`get_indexed_ann` for clarity.
Remove old search indexing tests
These unit tests which mock ES have been replaced with tests in
h/search/index_test.py which in most cases do actually make queries against
Elasticsearch and thus give us more confidence that passing tests ==
working production app.
Remove the majority of the old-style search query tests
Remove the tests in old_query_test.py which cover functionality that is
also covered by the tests in query_test.py.

Add a note about one aspect of searching by URI which is not explicitly
covered in query_test.py and a note about needing to move the remaining
`Builder` tests.
Commits on Aug 26, 2018
Commits on Aug 27, 2018
Remove test that is covered by another in query_test.py
This case is covered by `TestBuilder.test_it_sorts_annotations` in
query_test.py.
Merge pull request #5241 from hypothesis/remove-old-search-query-tests
Remove the majority of the old-style search query tests
Merge pull request #5223 from hypothesis/spike-organization-nullable
Make Group.organization nullable and create new private groups with no organization
Merge pull request #5244 from hypothesis/decrease-min-group-name-to-3
Decrease min group name to 3 characters
Commits on Aug 28, 2018
Install tox when running docs-related make commands
Automatically install `tox` in the developer's virtualenv when running
any of the various docs-related `Makefile` commands.

This fixes an issue that, if the developer didn't already have `tox`
available on their system, the various docs-related `Makefile` commands
will fail.

Having the `Makefile` explicitly install `tox` is consistent with how
`make test` already does it.

The use of `PIP_REQUIRE_VIRTUALENV` in the `Makefile` prevents `tox`
from being installed if the developer hasn't created and activated a
virtualenv for h - it won't try to install `tox` globally.
Merge pull request #5218 from hypothesis/connect-api-policy
Use API Policy; Restrict AuthClientPolicy to `POST /api/groups`
Commits on Aug 29, 2018
Record which /api/search params are used
Add custom metrics to record if the offset param is being used-the
idea being we will know if people are still using it as it will be
deprecated and perhaps when no one is using it anymore we can safely
delete it.

Add custom metrics to record the use of tag and tags. tags is an alias
of tag. The idea being if no one is using it we could safely remove this
and simplify our search query params.

Add custom metrics to record the use of url and uri. url is an alias
of uri. The idea being if no one is using it we could safely remove this
and simplify our search query params.
Remove New Relic agent configuration for elasticsearch1 library
The elasticsearch1 library is no longer used by the h app following the
Elasticsearch 6 migration.
Remove elasticsearch1-dsl library from tox setup
elasticsearch1-dsl is no longer used by h tests.
Add New Relic env vars to `run-docker` make task
This makes it easier to run h with New Relic reporting enabled locally
for performance analysis etc.

To use it:

 1. Set the `NEW_RELIC_LICENSE_KEY` env var to the key from your NR
    Account Settings page.
 2. Run `make docker` to build the docker image from git's HEAD commit
 3. Run `make run-docker`.

Metrics will now appear under the "h (dev)" application in your NR
account.

If you need more flexibility, see Hannah's answer at
https://stackoverflow.com/c/hypothesis/questions/98
Commits on Aug 30, 2018
Merge pull request #5249 from hypothesis/add-api-usage-metrics
Record which /api/search params are used
Merge pull request #5250 from hypothesis/remove-es1-newrelic-hooks
Remove remaining references to elasticsearch1 and elasticsearch1-dsl from config files
Merge pull request #5252 from hypothesis/remove-remaining-if-es1-swit…
…ches

Remove remaining es1 switch statement
Merge pull request #5253 from hypothesis/move-old-query-tests
Move old Builder tests to query_test module
Add helper for validating query parameters using Colander
Add `validate_query_params` helper function for validating query
parameters (`request.GET` or `request.params`) using Colander schemas.

Compared to simply calling `schema.deserialize(request.params)` this
helper handles:

 - Raising a `ValidationError` with a single string error
   message if validation fails.

 - Preserving repeated fields. Ordinarily Colander will only return the
   last occurrence after parsing.

   In our case we want to preserve repeated fields for use in eg.
   requests such as `GET /api/search?tag=foo&tag=bar` to return
   annotations with tags "foo" and "bar".
Merge pull request #5247 from hypothesis/colander-query-param-validation
Add helper for validating query parameters using colander
Commits on Aug 31, 2018
Add test to TestValidateQueryParams
Add test to check that a list field type can have a single value
specified and it still gets converted to a list in the multidict
to dict conversion and passes validation.
Merge pull request #5251 from hypothesis/add-newrelic-vars-to-run-docker
Add New Relic env vars to `run-docker` make task
Limit search "offset" parameter to <= 9800
The window of annotations,from + size must be less than or equal to: 10000.
Since limit (the size) is set to be no larger than 200, that means the
offset must be no larger than 9800.
Add colander SearchParamsSchema schema class
This schema will only pass expected search query params through to
be used when building the query. All unknown parameters will be ignored.
It also casts the parameters to their desired types and validates the value.

The following available fields in elasticsearch were not exposed for the following
reasons:

- deleted    There is a deleted filter that filters out deleted annotations
             everytime a search is run so exposing this would have no affect.
- id         This doesn't appear to work in practice and we prob shouldn't be
             exposing id's from our db anyway.
- nipsa      There is a filter for this that sorts these out so this would have
             no affect, not to mention exposing this could potentially allow
             a shadowbanned user from discovering they have been banned.
- shared     There is a filter for this already so it would have no effect, not
             to mention exposing this could be a permission escalation.
- tags_raw   There is already a nicer tags field for tag searches. The intention
             of tags_raw is to be used in aggregations.
- uri.parts  This is already covered by the any filter and keyword.
- user_raw   There is already a nicer tags field for user searches. The intention
             of user_raw is to be usedin aggregations.
- authority  There is a filter for this used on activity pages and this could be
             a permission escalation. Also this is something internal to h that we
             probably should avoid exposing anyway.
- updated    This is a date and it needs a range query filter which
             we don't currently have.

- created    This is a date and it needs a range query filter which
            we don't currently have.
- thread_ids This needs a more sensible name like "parent_of_annotations".
- target     This is a somewhat complex object that the user would never be
            able to pass in. It's broken up into smaller objects already.
Validate search query params in /api/search
Call validate_query_params in /api/search.

Change the type of request.params used in the tests from a dict
to a NestedMultiDict since this is what type request.params actually
is.

Since the SearchParamsSchema specifies defaults for certain params,
test_it_searches has to be changed to assert the default params were
passed into search as opposed to an empty dict.
Commits on Sep 01, 2018
Merge pull request #5256 from hypothesis/revert-5224-ignore-unknown-e…
…s-query-params

Revert "Ignore unknown es query params"
Add test to TestValidateQueryParams
Add test to check that a list field type can have a single value
specified and it still gets converted to a list in the multidict
to dict conversion and passes validation.
Limit search "offset" parameter to <= 9800
The window of annotations,from + size must be less than or equal to: 10000.
Since limit (the size) is set to be no larger than 200, that means the
offset must be no larger than 9800.
Add tests for sorting search by user, id, & group
Add tests for sorting search by user, id, and group.

Add mapping of sort by user to the non-analyzed field user_raw.
Add colander SearchParamsSchema schema class
This schema will only pass expected search query params through to
be used when building the query. All unknown parameters will be ignored.
It also casts the parameters to their desired types and validates the value.

The following available fields in elasticsearch were not exposed for the following
reasons:

- deleted    There is a deleted filter that filters out deleted annotations
             everytime a search is run so exposing this would have no affect.
- id         This doesn't appear to work in practice and we prob shouldn't be
             exposing id's from our db anyway.
- nipsa      There is a filter for this that sorts these out so this would have
             no affect, not to mention exposing this could potentially allow
             a shadowbanned user from discovering they have been banned.
- shared     There is a filter for this already so it would have no effect, not
             to mention exposing this could be a permission escalation.
- tags_raw   There is already a nicer tags field for tag searches. The intention
             of tags_raw is to be used in aggregations.
- uri.parts  This is already covered by the any filter and keyword.
- user_raw   There is already a nicer tags field for user searches. The intention
             of user_raw is to be usedin aggregations.
- authority  There is a filter for this used on activity pages and this could be
             a permission escalation. Also this is something internal to h that we
             probably should avoid exposing anyway.
- updated    This is a date and it needs a range query filter which
             we don't currently have.

- created    This is a date and it needs a range query filter which
            we don't currently have.
- thread_ids This needs a more sensible name like "parent_of_annotations".
- target     This is a somewhat complex object that the user would never be
            able to pass in. It's broken up into smaller objects already.
Validate search query params in /api/search
Call validate_query_params in /api/search.

Change the type of request.params used in the tests from a dict
to a NestedMultiDict since this is what type request.params actually
is.

Since the SearchParamsSchema specifies defaults for certain params,
test_it_searches has to be changed to assert the default params were
passed into search as opposed to an empty dict.
Commits on Sep 04, 2018
Fix a tox warning and remove some duplication
Fix a "Conflicting basepython for environment 'functional-py3'" warning
that tox was printing out, and also remove some duplication from the
tox.ini file.

The problem was that tox testenv names, such as "py27", "functional",
"functional-py3", "coverage", etc in our tox.ini file, are actually
hyphen-separated lists of what tox calls "factors":

https://tox.readthedocs.io/en/latest/config.html?highlight=factors#factors-and-factor-conditional-settings

Tox sees the testenv name "functional-py3" as two factors "functional"
and "py3". And "py3" is the name of one of tox's builtin factors.
The testenv name "functional-py3" activates the builtin "py3" factor
which sets `basepython = python3`. This conflicts with the
`basepython = python3.6` within the testenv definition
(py3 != python3.6).

Fix this by:

1. Renaming the functional-py3 testenv to functional-py36, so that it
   triggers the builtin py36 factor (basepython = python3.6) instead of
   the py3 one.

2. Removing the `basepython = python3.6` from the testenv definition
   body. It's not needed as the "-py36" in the testenv name has already
   set that basepython.

Also remove the `basepython = python2.7` from `[testenv:functional]` as
it's not needed - testenvs inherit the `basepython` from the default
testenv which, in our tox.ini file, is tox's builtin py27 testenv.

Also remove the `skip_install = true` from `[testenv:functional]` - it
already inherits this from `[testenv]`.

Also remove some duplication by adding a `tox.ini`-file section
`[functional]` and having both `[testenv:functional]` and
`[testenv:functional-py36]` use values from it.
Remove Sphinx deps
`make docs` and other docs-related Makefile commands run in tox-managed
venvs, so it's no longer necessary to install docs stuff in yout
development venv.
Merge pull request #5259 from hypothesis/fix-tox-warning
Fix a tox warning and remove some duplication
Use elasticsearch_dsl in filters
Convert filters/matchers/aggs to use elasticsearch_dsl. This means
now each filter will take in a search argument that is the elasticsearch_dsl
search object. Filters/Matchers will return a new modified search object,
while aggs will modify the search object in place.

Refactor the Search class to use these new classes and remove use of the old
Builder class.
Reorg existing tests into test classes
Reorganize the existing tests into their corresponding test classes:
TestSorter, TestLimiter, and TestKeyValueMatcher.
Commits on Sep 05, 2018
Merge pull request #5219 from hypothesis/replace-builder-with-dsl
Replace Builder class with elasticsearch_dsl
Fix RSS stream
The `/stream.rss` and `/stream.atom` views were broken by
6c342c7 because the `params.copy()`
call in `h.search.query.Builder.build` was removed. As a result
`Search.run` tried to modify its input `params` dict which crashed in
views were that argument is the read-only `request.params`.

It seems less surprising for `Search.run` not to mutate its input dict,
so restore that behavior.
Create new `h.schemas.forms.accounts.edit_profile` module and tests
Update `h.views.accounts` to use new `EditProfileSchema`
Remove `EditProfileSchema` from `h.accounts.schemas`
Create new `h.schemas.forms.accounts.login` module and tests
Update `h.views.accounts` to use new `LoginSchema`

Remove `LoginSchema` from `h.accounts.schemas`
Create new `h.schemas.forms.accounts.forgot_password` module and tests
Update `h.views.accounts` to use new `ForgotPasswordSchema`

Remove `ForgotPasswordSchema` from `h.accounts.schemas`
Create new `h.schemas.forms.accounts.reset_password` module and tests
Update `h.views.accounts` to use new `ResetPasswordSchema`

Remove `ResetPasswordSchema` from `h.accounts.schemas`
Merge pull request #5255 from hypothesis/refactor-accounts-schemas
Factor out some of `h.accounts.schemas` into separate modules
Merge pull request #5267 from hypothesis/revert-5255-refactor-account…
…s-schemas

Revert "Factor out some of `h.accounts.schemas` into separate modules"
Create new `h.schemas.forms.accounts.edit_profile` module and tests
Update `h.views.accounts` to use new `EditProfileSchema`
Remove `EditProfileSchema` from `h.accounts.schemas`
Create new `h.schemas.forms.accounts.login` module and tests
Update `h.views.accounts` to use new `LoginSchema`

Remove `LoginSchema` from `h.accounts.schemas`
Create new `h.schemas.forms.accounts.forgot_password` module and tests
Update `h.views.accounts` to use new `ForgotPasswordSchema`

Remove `ForgotPasswordSchema` from `h.accounts.schemas`
Create new `h.schemas.forms.accounts.reset_password` module and tests
Update `h.views.accounts` to use new `ResetPasswordSchema`

Remove `ResetPasswordSchema` from `h.accounts.schemas`
Make `h.views.api.groups` handle userid ValueError from user service
Make sure the view does not expose the ValueError that can result
from invoking the `fetch` method on the `user_service` with a
malformed `userid`.

Return a 404 instead.
Commits on Sep 06, 2018
Add search_after in search query & tests
Previously the param "offset" was being used to set the
"from" property in the search query to search from "offset" annotations to
"limit" number of annotations. This will be deprecated.

Going forward, it will use the param "search_after" to set the
"search_after" property in the search query to search starting at
sort field "search_after" to "limit" number of annotations.

search_after does not run through the parser to format the dates so we
must run the datetime parsing before it is passed to search_after. search_after
only accepts the number epoch_miliseconds as that is the raw format in es for
the created and updated fields.

Add tests for search_after.
Ignore/strip offset when search_after is specified
Offset has been deprecated in favor of search_after. This means both
the Limiter and the Sorter have to handle the case where both offset
and search_after have been specified. This is because we make no
guarantee that the Sorter will be run before the Limiter or vise
versa.

If the Sorter is run first the offset should be popped.

If the Limiter is run first the offset should be popped and ignored.

Add tests for both cases ^.

Cleanup the extract offset and limit logic.
Validate search_after interactions in the schema
Validate at the schema level the following:
 - Validate that search_after is the correct format based on the value
   of sort.
 - Default offset to 0 if search_after is set.

Add schema tests to validate the above additions to the schema validation.

Remove the handling of both offset and search_after being set in the
Sorter and Limiter classes since this is now handled by the schema.

Remove query tests that validate the handling of both offset and
search_after being set since this is handled by the schema now.
Include CORS headers on error responses from the API
The `h.views.api.config.api_config` decorator applies a CORS header decorator
to API views, but the headers added by this decorator are not applied if
any part of the view processing pipeline raises an exception and an
exception view is invoked instead. Given that most API error handling
involves raising exceptions which then render responses using views in
`h.views.api.exceptions`, the result is that CORS headers were not set.

As a result, failing API requests caused surprising and confusing error
messages in the console about disallowed cross-origin requests, instead
of reporting the actual error.

Fixes #5264
Remove code that establishes elasticsearch_dsl's default connection
We are using elasticsearch_dsl for generating and executing search
queries in app code and tests, but we've opted to stick with the
existing method of establishing a connection to Elasticsearch rather
than using elasticsearch_dsl's default connection.

The existing method of creating a connection and exposing it via
`request.es` is convenient to work with in tests, since it can be easily
mocked. It is also more consistent with how we set up and expose
connections to other external services such as statsd or the database
session.
Update breaking tests for `request.default_authority`
These tests are for modules whose code doesn’t have any broken
references to `request.authority`, but their tests do
Merge pull request #5254 from hypothesis/default-authority
Change `request.authority` -> `request.default_authority`
Enable CORS headers on `json_error` view
Despite being in `h/views/api/*` this view is used by some non-API
routes, which we may not want to be cross-origin readable. However it
doesn't leak any information about the error.

In future this will be split into two separate views for API and non-API
routes as per https://hypothes-is.slack.com/archives/C4K6M7P5E/p1536243261000100
Merge pull request #5270 from hypothesis/fix-api-error-view-cors-headers
Add missing CORS headers to API error responses
Split json_error exception view into API and non-API request handlers
We have API and non-API views that return JSON. For consistency handle
unexpected exceptions (aka. Internal Server Errors) for API views in
a view defined in `h/views/api/exceptions.py` and for other views in a
view defined in `h/views/exceptions.py`.

Right now the only difference is that the API view adds CORS headers to
the response.

I have also changed the error message to make it shorter and thus be
easier to read if it gets displayed to the user directly, eg. as the
Hypothesis client will do in a toaster at the top of the sidebar.
Add check_icu_plugin param to search.init
Instead of passing in a full dictionary of settings into search.init,
change search.init to accept a single boolean value for check_icu_plugin
and default it to True. This way the settings don't get passed around the
code, it is backwards compatible, and is a lot less invasive of a change.
Merge pull request #5220 from jmcarp/skip-plugin-check
Optionally skip elastic plugin check.
Merge pull request #5271 from hypothesis/remove-es-connect
Remove code that establishes elasticsearch_dsl's default connection
Commits on Sep 07, 2018
Fix date parsing logic
There was a problem where if a date that was just a year such as
"2017" was passed into the date parsing logic it would be interpreted
as ms since the epoch instead of going through the date parser.
This has been fixed along with some subtle cleanups to names of
methods and doc strings to make the code more readable.
Allow "uri.parts" as a query param argument to /api/search
This existing query param was missed when validation of query params to
the search API was added recently.

Many users of this parameter will be better served by the upcoming
wildcard URI search support, but since there were users of the existing
query param, it makes sense to continue to support it.
Merge pull request #5273 from hypothesis/split-json-error-view
Split json_error exception view into API and non-API request handlers
Merge pull request #5265 from hypothesis/api-docs-group-security
Fix security documentation for POST api/groups/{id}/members/{user}
Merge pull request #5268 from hypothesis/handle-userid-value-error-api
Make `h.views.api.groups` handle userid ValueError from user service
Merge pull request #5274 from hypothesis/client-authority-util
Add utility method to determine current auth client authority
Add minimal functional tests for RSS feeds
We inadvertently broke the RSS feeds in production. This was resolved in
#5262 but I think it would be useful
to have a couple of basic functional tests as extra security.
Commits on Sep 09, 2018
Merge pull request #5276 from hypothesis/add-uri-parts-to-schema
Allow "uri.parts" as a query param argument to /api/search
Commits on Sep 10, 2018
Merge pull request #5277 from hypothesis/rss-functional-tests
Add minimal functional tests for RSS feeds
Merge pull request #5278 from hypothesis/adjust-auth-client-principals
Change auth_client `authority` principal to `client_authority`
Commits on Sep 11, 2018
Commits on Sep 12, 2018
Merge pull request #5283 from hypothesis/log-warn-to-warning
Replace deprecated `log.warn` with `log.warning`
Extend AuthClient policy to member-add endpoint; use permission on view
Extend the AuthClient policy to `POST /api/groups/{pubid}/members/{userid}`
and change the group to authorize on permission `member_add` on Group

Remove old view-level auth code and update tests
Merge pull request #5279 from hypothesis/authz-for-add-group-member
Extend AuthPolicy, add Authorization to API add-group-member endpoint
Merge pull request #5285 from hypothesis/add-root-tests
Add rudimentary tests to `h.traversal.roots.Root`
Merge pull request #5284 from hypothesis/auth-client-role
Add `AuthClient` role-principal and assign it to authClient requests
Commits on Sep 13, 2018
Remove an unnecessary default value
This function is never called without passing `expand`, and `expand` is
never `None`.
Fix another dangerous default value
Remove the argument entirely because it's only ever used by the tests,
and the only to pass in the same value as the default value.
Change page title and button text for create group page.
Since we have different types of groups, and previously
we didn't explicitly say what type of group is created with
this form, we're updating the page title to be more clear.
Fixes #5290
Merge pull request #5291 from hypothesis/change-page-title
Change page title and button text for create group page.
Commits on Sep 14, 2018
Don't call pytest fixtures directly
Several tests were triggering "fixtures are not meant to be called
directly" warnings from pytest, and in a future version of pytest it
won't even be _possible_ to call fixtures directly. Fix the code to no
longer call fixtures directly.
Fix an SQLAlchemy unicode warning
We're reading the value of the X-Forwarded-User header, which in Python
2 is a byte string, and then using it in an SQLAlchemy query which is
triggering a unicode warning from SQLAlchemy:

    Unicode type received non-unicode bind param value

This is because we're passing SQLAlchemy a byte string and asking it to
match it against a unicode column.

Fix this by decoding the byte string to unicode first.

Once we've moved to Python 3 we can remove this decoding: request header
values are unicode already in Python 3.
Replace deprecated readfp()
Calling readfp() prints a warning in Python 3:

    DeprecationWarning: This method will be removed in future versions.  Use 'parser.read_file()' instead.

Fix this by calling read_file() instead. But read_file() isn't available
in Python < 3.2, so still use readfp() in older versions.

Here's the docs for the old, deprecated readfp():

https://docs.python.org/2/library/configparser.html?highlight=readfp#ConfigParser.RawConfigParser.readfp

Here's the docs for the new read_file():

https://docs.python.org/3/library/configparser.html?highlight=read_file#configparser.ConfigParser.read_file
Replace deprecated warn()
warn() is deprecated and prints a warning in newer versions of Python.
Use warning() instead.
Upgrade Jinja2
Upgrade Jinja2 to the latest version by running this command:

    $ pip-compile --upgrade-package jinja2

This fixes a warning that the tests were printing out when run in Python
3:

    DeprecationWarning: Flags not at the start of the expression '\\w+(?u)'

Changelog: http://jinja.pocoo.org/docs/2.10/changelog/
Merge pull request #5292 from hypothesis/dont-call-fixtures-directly
Don't call pytest fixtures directly
Merge pull request #5294 from hypothesis/fix-check_csrf-deprecation-w…
…arning

Fix Pyramid deprecation warning
Fix invalid string escapes
\ is the escape character in Python string literals:

https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals

For example if you want to put a tab character in a string you would do:

    >>> print("foo \t bar")
    foo 	 bar

If you want to put a literal \ in a string you have to use \\:

    >>> print("foo \\ bar")
    foo \ bar

Or use a "raw string":

    >>> print(r"foo \ bar")
    foo \ bar

You can't just go putting backslashes in string literals whenever you
want one. A backslash isn't valid when not followed by one of the valid
escape sequences, and newer versions of Python print a deprecation
warning. For example \A isn't an escape sequence:

    $ python3.6 -Wd -c '"\A"'
    <string>:1: DeprecationWarning: invalid escape sequence \A

See: https://bugs.python.org/issue27364

If your backslash sequence does accidentally match one of Python's
escape sequences, but you didn't mean it to, that's even worse.

So you should always use raw strings or \\.

It's important to remember that a string literal is still a string
literal even if that string is intended to be used as a regular
expression. Python's regular expression syntax supports lots of special
sequences that begin with \. For example \A matches the start of a
string. But \A is not valid in a Python string literal! This is invalid:

    my_regex = "\Afoo"

Instead you should do this:

    my_regex = r"\Afoo"

See: https://docs.python.org/3/library/re.html

Docstrings are another one to remember: docstrings are string literals
too, and invalid \ sequences are invalid in docstrings too! Use raw
strings (`r"""..."""`) for docstrings if they contain \'s.
Commits on Sep 15, 2018
Commits on Sep 17, 2018
Add UriCombinedWildcardFilter
Searching for a partial url is a common use case. It is particularly
useful for publishers who want to know who has been making annotations
on all their articles. It is also useful for users who simply can't
remember the entire url of an article they have annotated.

Add UriCombinedWildcardFilter has two configurations:
 1. seperate_keys=True
    Wildcards are only present in wildcard_uri param values and exact
    matches are present in uri/url param values.
 1. seperate_keys=False
    Wildcards and exact matches are present in uri/url param values.

UriCombinedWildcardFilter igores all wildcard uri's that have wildcards
in the domain.

Remove UriFilter from default modifier list in Search class since
the UriCombinedWildcardFilter will need to replace it in certain
cases and there is no way to selectively remove modifiers. The
current design pattern is if the modifier is used by all searches,
then it is in the default list, since it will not be, drop it from
the default list.

Add both UriFilter and UriCombinedWildcardFilter's to the search __init__
module as they will be appended to the Search class modifier list as needed.

Modify all existing code that runs Search to append the UriFilter to the list
of modifiers before running a search.
Normalize http://foo.com/* to http://foo.com
Import urlparse from h._compat
Wildcard uri's that don't contain wildcards are invalid.
Simplify test_matches tests.
Normalize http://foo.com/* to http://foo.com by also stripping `*`'s
before normalizing wildcard uri's.

fixup
fixup: logic for uri's w/o authority
Improve wording of Ignore invalid uri's comment.

s/compinsate/compensate

Escape backslashes in docstring.

s/ending_question_wildcard/trailing_wildcard in wildcard normalizer.

s/expected/expected_ann_idxs in test_matches.
Remove use of using="default" for es connection
Since we chose not to go forward with using elasticsearch-dsl to
generate an elasticsearch connection, using "default" doesn't make
sense so simply pass the elasticsearch-dsl search the request.es.conn
in the tests instead.
This keeps the tests consistent with the rest of the code.
Commits on Sep 18, 2018
Merge pull request #5303 from hypothesis/remove-use-of-es-dsl-default…
…-connection

Remove use of using="default" for es connection
Merge pull request #5287 from hypothesis/fail-tests-on-warnings
Make the tests fail if any warnings are printed
Append UriCombinedWildcardFilter in /api/search
This will allow searching for uri's containing wildcards via the
wildcard_uri parameter.

Add the wildcard_uri parameter to the schema and raise a validation
error if the uri value is invalid (aka contains wildcards in the
domain of the uri).

Update the docs to reflect the additional wildcard_uri parameter.
Default search_after date to 1/1/1970 00:00:00 0ms
Datetimes default the date to be the current date for fields that
aren't specified. This behavior is unintuitive and undesireable.
Dates should be defaulted to the first month, first day, 00:00:00 0ms.
Merge pull request #5286 from hypothesis/add-uri-wildcard-to-api-search
Add wildcard_uri parameter to /api/search
Commits on Sep 19, 2018
Merge pull request #5302 from hypothesis/fix-default-search-query-date
Default search_after date to 1/1/1970 00:00:00 0ms
Commits on Sep 20, 2018
Add a field called hidden to an annotation document at the time of in…
…dexing.

This new field is set when all children of an annotation AND the
annotation itself, have been moderated.
We will then use this field to determine which annotations are displayed
and which ones are filtered out.

See hypothesis/product-backlog#583
Merge pull request #5289 from hypothesis/nipsas
Add a field called hidden to an annotation document at the time of indexing
Commits on Sep 22, 2018
Enable searching for wildcard url's on activity pages (#5299)
* Add UriCombinedWildcardFilter to activity pages

Replace the UriFilter with the UriCombinedWildcardFilter on activity
pages so that the url facet now accepts and searches for wildcard urls.

Add a test.

* Add wildcard desc to url facet on activity pages

* Switch on wildcard activity page feature flag

* fixup: change wording of url facet
Commits on Sep 24, 2018
Use popall in es search query modifiers (#5304)
* Use _pop_param_values in es search query modifiers

Previously each modifier had essentially the same code to extact
all values of the same key from the params multidict, now they just
call _pop_param_values(key) instead.

Some of the tests were passing in a dict-type value for params instead of
a MultiDict-type. This change forces the params to now be a MultiDict as it
uses a MultiDict-only method called getall().

* Set params type MultiDict in Search.run doc-string

* Rename _pop_param_values to popall

* Change Search to no longer make a copy of params

Search previously made a copy of the params that were passed to it.
This functioned mainly as a way of casting a NestedMultiDict type (readonly)
coming from request into a MultiDict type (mutable). Search calls
query filters that pop the params. In half of the cases where Search
is used, the params that are passed in are already in a poppable state
and copying is expensive thus let the code that calls Search decide whether
to copy/cast the params or not.

The badge view and tests were updated to pass a MultiDict.

The feeds view was updated to cast the request.params into a MultiDict.

The test for verifying the Search doesn't modify params was removed as this
is now expected behavior.

Update the description of params to explain that they will be popped.
Commits on Sep 26, 2018
Update AuthClientPolicy route whitelisting
The former method of pattern-matching on request.path was kludgy and
resulted in at least one bug from oversight. The new whitelist here
is easier to read as a human and is matched against the
request’s `matched_route` object.
Protect `POST /api/users` with permission instead of view logic
Remove view-level auth* checking on auth-client as authn now happens
in AuthClientPolicy and authz via a permission on the `UserRoot`
traversal root.

This endpoint will temporarily return a 404 instead of a 403 on
authz fail because of the way that API view exceptions intercept
403s. To be fixed soon
raise `ValidationError` if `authority` param mismatch
Raise a `ValidationError` if supplied `authority` param
does not match the verified auth client authority
Merge pull request #5314 from hypothesis/admin-auth-client-warning
Add security warning on admin/create-oauth-client form
Merge pull request #5309 from hypothesis/filters
Add new HiddenFilter to filter annotations which are moderated or belong to a nipsaed user.
Update documentation about API Authorizations
Expand explanation of `clientCredentials` and add section for
forwarded users
Commits on Sep 27, 2018
Merge pull request #5317 from hypothesis/revert-5309-filters
Revert "Add new HiddenFilter to filter annotations which are moderated or belong to a nipsaed user."
Merge pull request #5316 from hypothesis/api-authorization-docs
Update documentation about API Authorizations
Merge pull request #5315 from hypothesis/api-index
Factor out new `h.views.api.index` module
Merge pull request #5288 from hypothesis/add-create-user-permission
Add create user permission and update `POST /api/users` authz
Make `UserRoot.__getitem__` aware of `client_authority`
Make it possible to retrieve User models from third-party authorities
when a verified/auth’d auth client is present in the request.
Protect `PATCH /api/users/{username}` with a permission
Instead of using view-level logic, update the view to
match on a permission assigned in the User model’s ACL
Merge pull request #5319 from hypothesis/api-links
Factor out `links` module in `h.views.api`
Commits on Sep 28, 2018
Merge pull request #5320 from hypothesis/move-validators-schemas
Move `h.validators` -> `h.schemas.validators`
Merge pull request #5318 from hypothesis/add-update-user-permission
Add update-user permission; use AuthClient auth'n for `PATCH /api/user/{username}`
Showing 1,645 changed files with 108,362 additions and 184,672 deletions.
View
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
View

This file was deleted.

Oops, something went wrong.
View
@@ -0,0 +1,13 @@
[run]
branch = True
omit =
# development
h/debug.py
# migrations
h/migrations/*
[paths]
source =
src/memex
.tox/*/lib/python*/site-packages/memex
View
@@ -0,0 +1,20 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.{html,jinja2,js,json,scss,yaml,yml}]
indent_size = 2
[*.py]
indent_size = 4
[Makefile]
indent_style = tab
[{.travis.yml}]
indent_size = 2
View
@@ -0,0 +1,12 @@
{
"extends": "hypothesis",
"rules": {
"arrow-parens": ["error", "as-needed", { "requireForBlockBody": true }],
"arrow-spacing": "error",
"no-var": "error",
"keyword-spacing": "error",
"prefer-arrow-callback": "error",
"prefer-const": ["error", { "destructuring": "all" }],
"space-before-blocks": "error"
}
}
View
@@ -1 +1,3 @@
h/_version.py export-subst
h/browser/chrome/content/build/* linguist-vendored
h/browser/chrome/content/web/* linguist-vendored
View
@@ -0,0 +1,36 @@
<!--
Thank you for reporting an issue with Hypothesis! This is our bug tracker. If
you have any support questions please email support@hypothes.is instead.
In order to make it easy for us to help you, please note the following:
1. Only report **bugs** with Hypothesis here. If you want to discuss potential
new features, please use our developer mailing list:
https://groups.google.com/a/list.hypothes.is/forum/#!forum/dev
2. Be sure to check that the bug you're reporting isn't already reported. You
can use the GitHub issues search box to help with this.
3. Fill out the information requested by the template below. If you can't supply
all the information, don't worry, but do please use the template.
-->
### Steps to reproduce
1.
2.
3.
### Expected behaviour
Tell us what should happen.
### Actual behaviour
Tell us what happens instead.
### Browser/system information
Tell us which browser, browser version, and operating system you were using when
you encountered this issue.
### Additional details
If you have other information which might be helpful, please include it. If a
screenshot will help to illustrate the issue you are reporting, please include
one.
View
@@ -0,0 +1,4 @@
# Label to use when marking as stale
staleLabel: stale
# Limit to only `issues` or `pulls`
only: pulls
View
@@ -1,27 +1,38 @@
/*.db
/*.db-journal
/*.egg
/*.egg-info
/*.ini
/MANIFEST
/bin
/build
/dist
/docs/_build
/h/css
/h/js
/h/lib
/h/static/.sass-cache
/h/static/.webassets-cache
/include
/lib
/local
/man
/node_modules
/share
/src
MANIFEST
build/
dist/
docs/_build/
node_modules/
# Pyramid debug mailer
mail/
# py.test state cache
.cache/
.coverage
.coverage.*
.hypothesis/
.tox/
.eggs/
*.egg
*.egg-info
.pydeps
.pytest_cache
# development TLS cert/key
.tlscert.pem
.tlscsr.pem
.tlskey.pem
*.pyc
*.pyo
*.pid
*.log
celerybeat-schedule
celerybeat-schedule.*
# Temp file for `make test-py3` target
tests/py3-actual-failures.txt
View
@@ -0,0 +1,26 @@
A. Frederick Dudley <a.frederick.dudley@gmail.com>
Alice Wyan <alice@finitud.org> Alice Wyan <finitud@users.noreply.github.com>
Alice Wyan <alice@finitud.org> keybase.io/wyan <wyan@keybase.io>
Aron Carroll <aron@hypothes.is> Aron Carroll <aron@users.noreply.github.com>
Aron Carroll <aron@hypothes.is> Aron Carroll <self@aroncarroll.com>
Benjamin Young <byoung@bigbluehat.com>
Christof Dorner <christof@chdorner.com>
Conor Delahunty <conordelahunty@hypothes.is>
Gerben <gerben@treora.com> Gerben <Treora@users.noreply.github.com>
Gergely Ujvari <ujvari@hypothes.is>
Gergely Ujvari <ujvari@hypothes.is> Ujvari Gergely <ujvari@cliqz.com>
Gergely Ujvari <ujvari@hypothes.is> ujvari <ujvari@Nibiru.Gaia>
Jake Hartnell <jakehartnell@hypothes.is>
Jake Hartnell <jakehartnell@hypothes.is> Jake Hartnell <Jake.Hartnell@berkeley.edu>
Jake Hartnell <jakehartnell@hypothes.is> Jake Hartnell <Jake.Hartnell@gmail.com>
Jake Hartnell <jakehartnell@hypothes.is> Jake Hartnell <JakeHartnell@hypothes.is>
Jake Hartnell <jakehartnell@hypothes.is> Jake Hartnell <RawKStar77@aol.com>
Jake Hartnell <jakehartnell@hypothes.is> RawKStar77 <RawKStar77@aol.com>
Jehan Tremback <jehan.tremback@gmail.com> Jehan <jehan.tremback@gmail.com>
José Padilla <jpadilla@webapplicate.com>
Kristof Csillag <csillag@hypothes.is> Kristof Csillag <csillag@nolmecolindor.com>
Kristof Csillag <csillag@hypothes.is> csillag <csillag@harmacolindor.com>
Lena Gunn <lenazun@gmail.com>
Randall Leeds <tilgovi@hypothes.is> Randall Leeds <randall.leeds@gmail.com>
Randall Leeds <tilgovi@hypothes.is> Randall Leeds <randall@bleeds.info>
Sean Hammond <git@seanh.cc> Sean Hammond <seanh@users.noreply.github.com>
View
@@ -1,19 +1,63 @@
output_format: grouped
inherits:
- full_pep8
- strictness_low
output-format: grouped
strictness: veryhigh
doc-warnings: true
max-line-length: 160
# We run flake8 first and then prospector as a second-pass linter.
# Since flake8 already runs pyflakes, pep8 and mccabe, don't run them again
# with prospector.
mccabe:
run: false
pep8:
run: false
pep257:
disable:
- D203 # "1 blank line required before class docstring" conflicts with
# another pep257 rule D211 "No blank lines allowed before class
# docstring"!
- D212 # "Multi-line docstring summary should start at the first line"
# conflicts with another pep257 rule D213 "Multi-line docstring
# summary should start at the second line"
pyflakes:
run: false
pylint:
enable:
- relative-import
disable:
# This check (for missing method arguments) is broken in latest pylint:
#
# https://bitbucket.org/logilab/pylint/issue/205
- E1120
# This check (for inherited objects to be classes) is broken in pylint 1.4
# for zope.interface.Interface.
- E0239
pep8:
- line-too-long # PEP8 checks this and doesn't complain about
# unavoidable long lines (such as URLs).
- missing-docstring # The pep257 tool reports missing docstrings to us
# so we don't need pylint to do so.
- too-few-public-methods
options:
max-line-length: 79
ignore:
- "^_version.py"
- "^migrations/"
# Some good names that pylint would otherwise reject:
#
# - _: placeholder
# - i,j,k: counters
# - k,v: dict iteration
# - db,fn: common abbreviations
# - fp: python idiom for file handles
#
# Some good "constant" names that pylint would otherwise reject:
#
# - log: common in "log = logging.getLogger(__name__)" pattern
# - parser: common in modules that use argparse
# - id: Commonly used as a class attribute / database column name in
# sqlalchemy model classes. Note that if you use id as the name of
# a local variable or parameter, pylint will still complain that
# you're shadowing the builtin.
#
good-names: _,i,j,k,v,e,db,fn,fp,log,parser,id,es
pyroma:
run: true
ignore-paths:
- gunicorn.conf.py
- h/_version.py
- h/migrations/
- h/static/
- node_modules/
- versioneer.py
ignore-patterns:
- '.*\.egg'
- '.*conftest\.py'
View
@@ -0,0 +1,4 @@
# autogenerated pyup.io config file
# see https://pyup.io/docs/configuration/ for all available options
update: insecure
View
@@ -1,25 +1,75 @@
language:
- python
python:
- '2.7'
before_install:
- sudo /usr/share/elasticsearch/bin/plugin -install elasticsearch/elasticsearch-analysis-icu/2.3.0
- sudo service elasticsearch restart
install:
- gem install sass
- gem install compass
- pip install prospector
- make
services:
- elasticsearch
script:
- make test
- prospector -P .prospector.yaml h
- hypothesis extension development.ini chrome http://localhost
- hypothesis extension development.ini firefox http://localhost
# use Travis container build infrastructure
sudo: false
matrix:
include:
# Python (backend) tests
- env: ACTION=tox
language: python
python: '2.7'
addons:
postgresql: "9.4"
before_install:
- ./scripts/elasticsearch.sh
install: pip install tox
before_script: createdb htest
script: tox
after_success:
tox -e coverage
tox -e codecov
- env: ACTION=tox-py3
language: python
python: '3.6'
addons:
postgresql: '9.4'
before_install:
- ./scripts/elasticsearch.sh
install: pip install tox
before_script: createdb htest
script:
make test-py3
# Test web application frontend
- env: ACTION=gulp
language: node_js
# We currently build production against Alpine v3.4:
#
# https://pkgs.alpinelinux.org/packages?name=nodejs&branch=v3.4
node_js: '6.7'
before_install: npm install gulp-cli
script: gulp test
# Lint frontend code
- env: ACTION=frontend-lint
language: node_js
node_js: '6.7'
script:
gulp lint
# Lint backend code
- env: ACTION=backend-lint
language: python
python: '3.6'
script:
make lint
# Check the docs build for warnings or errors.
- env: ACTION=check-docs
language: python
python: '3.6'
install: pip install tox
script:
make checkdocs
cache:
directories:
- node_modules
- $HOME/.cache/pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
notifications:
irc:
channels:
"chat.freenode.net#hypothes.is"
on_success: "change"
on_failure: "always"
slack:
rooms:
- secure: SKPwtfoH32aDop6hLhQdgrUhl58gM6CMBUATMdq0KMmEwCxskPbIArqxGUKxeeiO3c3jBQ+Yuq3b4m8GbR2AJxxelO0DRLNyV1lAjfeJ/QzCc3Taxqo0yel4uAFNg/oCYWH50dv2oAgDP3CHk/tKXmsgDWOjcm6A6k35xst16xI=
on_success: change
on_failure: always
Oops, something went wrong.

No commit comments for this range