Skip to content

Commit

Permalink
chore: purge store-base (#4825)
Browse files Browse the repository at this point in the history
  • Loading branch information
M7mdisk authored Sep 2, 2024
1 parent 0a8627a commit 564c147
Show file tree
Hide file tree
Showing 11 changed files with 506 additions and 45 deletions.
2 changes: 1 addition & 1 deletion entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

RUN_COMMAND="talisker.gunicorn.gevent webapp_beta.app:app --bind $1 --worker-class gevent --workers 2 --name talisker-`hostname`"
RUN_COMMAND="talisker.gunicorn.gevent webapp.app:create_app() --bind $1 --worker-class gevent --workers 2 --name talisker-`hostname`"

if [ "${FLASK_DEBUG}" = true ] || [ "${FLASK_DEBUG}" = 1 ]; then
RUN_COMMAND="${RUN_COMMAND} --reload --log-level debug --timeout 9999"
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ canonicalwebteam.search==1.3.0
canonicalwebteam.image-template==1.3.1
canonicalwebteam.store-api==5.0.0
canonicalwebteam.launchpad==0.9.0
canonicalwebteam.store-base==1.3.0
django-openid-auth==0.17
Flask-OpenID==1.3.0
Flask-WTF==1.2.1
Expand Down
2 changes: 1 addition & 1 deletion static/js/store/pages/Packages/Packages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Packages(): ReactNode {
const CATEGORY_ORDER = getCategoryOrder();

const getData = async (queryString: string) => {
const response = await fetch(`/beta/store.json${queryString}`);
const response = await fetch(`/store.json${queryString}`);
const data: {
total_items: number;
total_pages: number;
Expand Down
10 changes: 5 additions & 5 deletions static/js/store/pages/Packages/__tests__/Packages.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe("Packages", () => {
renderComponent();
await waitFor(() => {
expect(global.fetch).toHaveBeenCalledWith(
"/beta/store.json?categories=featured"
"/store.json?categories=featured"
);
});
});
Expand All @@ -154,7 +154,7 @@ describe("Packages", () => {
await user.click(screen.getByLabelText("Development"));
await waitFor(() => {
expect(global.fetch).toHaveBeenCalledWith(
"/beta/store.json?categories=development"
"/store.json?categories=development"
);
});
});
Expand All @@ -167,7 +167,7 @@ describe("Packages", () => {
await user.click(screen.getByLabelText("Development"));
await waitFor(() => {
expect(global.fetch).toHaveBeenCalledWith(
"/beta/store.json?categories=development&q=code"
"/store.json?categories=development&q=code"
);
});
});
Expand All @@ -178,7 +178,7 @@ describe("Packages", () => {
await user.type(screen.getByLabelText("Search Snapcraft"), "code");
await user.click(screen.getByRole("button", { name: "Search" }));
await waitFor(() => {
expect(global.fetch).toHaveBeenCalledWith("/beta/store.json?q=code");
expect(global.fetch).toHaveBeenCalledWith("/store.json?q=code");
});
});

Expand Down Expand Up @@ -262,7 +262,7 @@ describe("Packages", () => {
await user.click(screen.getByLabelText("Development"));
await waitFor(() => {
expect(global.fetch).toHaveBeenCalledWith(
"/beta/store.json?categories=development"
"/store.json?categories=development"
);
});
});
Expand Down
3 changes: 3 additions & 0 deletions webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from webapp.snapcraft.views import snapcraft_blueprint
from webapp.store.views import store_blueprint
from webapp.tutorials.views import init_tutorials
from webapp.packages.store_packages import store_packages


TALISKER_WSGI_LOGGER = logging.getLogger("talisker.wsgi")
Expand All @@ -39,6 +40,7 @@ def create_app(testing=False):
static_folder="../static",
)
app.config.from_object("webapp.config")
app.name = "snapcraft"
app.testing = testing

if not testing:
Expand All @@ -50,6 +52,7 @@ def create_app(testing=False):
set_handlers(app)

app.register_blueprint(snapcraft_blueprint())
app.register_blueprint(store_packages)
app.register_blueprint(first_snap, url_prefix="/first-snap")
app.register_blueprint(login)
app.register_blueprint(oauth)
Expand Down
2 changes: 2 additions & 0 deletions webapp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ class ConfigurationError(Exception):
SEARCH_API_KEY = os.getenv("SEARCH_API_KEY")
SEARCH_API_URL = "https://www.googleapis.com/customsearch/v1"
SEARCH_CUSTOM_ID = "009048213575199080868:i3zoqdwqk8o"

APP_NAME = "snapcraft"
Loading

0 comments on commit 564c147

Please sign in to comment.