Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions helm-quarry/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
web:
repository: 'quay.io/wikimedia-quarry/quarry'
tag: pr-90 # web tag managed by github actions
tag: pr-92 # web tag managed by github actions
resources:
requests:
memory: "300Mi"
Expand All @@ -11,7 +11,7 @@ web:

worker:
repository: 'quay.io/wikimedia-quarry/quarry'
tag: pr-90 # worker tag managed by github actions
tag: pr-92 # worker tag managed by github actions
resources:
requests:
memory: "400Mi"
Expand Down
6 changes: 5 additions & 1 deletion quarry/web/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import current_app, Flask, render_template, g
from flask import current_app, Flask, render_template, g, Response
from flask_caching import Cache
from werkzeug.middleware.proxy_fix import ProxyFix

Expand Down Expand Up @@ -72,6 +72,10 @@ def index():
stats_count_runs=global_conn.session.query(QueryRun).count(),
)

@app.route("/robots.txt")
def robots_txt():
return Response("User-Agent: *\nDisallow: /\n", mimetype="text/plain")

return app


Expand Down
6 changes: 6 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ def test_frontpage(self, mocker, client):
assert response.data
assert "5 users" in response.data.decode("utf8")
assert f"{5 * 3 * 3 * 3} queries" in response.data.decode("utf8")

def test_robots_txt(self, client):
response = client.get("/robots.txt")
assert response.status_code == 200
assert response.headers["Content-Type"] == "text/plain; charset=utf-8"
assert "User-Agent: *" in response.data.decode("utf8")