Skip to content

Multiple improvements during recent PTS25 #72

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

Merged
merged 30 commits into from
May 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a6640ee
Update cpanfile snapshot
atoomic May 1, 2025
37a4c89
Switch functions to use signature
atoomic May 1, 2025
b146413
Setup http headers to cache more pages
atoomic May 1, 2025
7f88efd
Bump assets to 20250501123741
atoomic May 1, 2025
c0c7140
Remove legacy /search/* route
atoomic May 1, 2025
ce90853
Cache the current_version for 10 min
atoomic May 1, 2025
835d508
Preserve filter in pagination
atoomic May 1, 2025
d1eb5f5
Switch to docker compose for dev & prod
atoomic May 1, 2025
8a84488
Only use mount point on dev for src
atoomic May 1, 2025
7cd165a
Update font-awesome to version 4.7.0
atoomic May 1, 2025
040a246
Fix ignore list in search
atoomic May 2, 2025
ccbee78
Fix pagination issue +/-10
atoomic May 2, 2025
ae257d1
Fix output parser to show more results
atoomic May 2, 2025
b26c65d
Enforce default list of ignored files
atoomic May 2, 2025
3f1abac
Update HomePage Design
atoomic May 2, 2025
039ca69
Wider inputs for search page form
atoomic May 2, 2025
1f117fb
Minor style for alert info on HomePage
atoomic May 2, 2025
ed6595f
Minor design tweaks for HomePage
atoomic May 2, 2025
68a2d48
Move the parse ignore rule later
atoomic May 2, 2025
864cb27
Cache improvements
atoomic May 3, 2025
09ca4c7
Add support for multiple search filter
atoomic May 3, 2025
f58c78d
Dynamic placeholders
atoomic May 3, 2025
7fbe8c2
Add some hint when using invalid search
atoomic May 3, 2025
dbefb19
Remove link to distro when already on distro page
atoomic May 3, 2025
a63cee3
Mount repo read only
atoomic May 3, 2025
0cb6984
Simplify env for testing
atoomic May 3, 2025
05a8b14
Add test target to run tests
atoomic May 3, 2025
0dc5f7a
Add GitHub CI to run tests
atoomic May 3, 2025
fd35791
Setup docker container for testing
atoomic May 3, 2025
5f5ef1a
Rename build-production-container
atoomic May 4, 2025
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
6 changes: 6 additions & 0 deletions .docker/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ~/.docker/config.json
{
"features": {
"buildkit": true
}
}
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .dockerignore

.git
.gitignore

README.md

deploy/
launcher/
local/

src/blib/
src/environments/*docker*
src/lib/
src/public/
src/t/
src/var/
src/views/

tools/

.env
*.log
*.swp
9 changes: 9 additions & 0 deletions ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
---
name: 🐛 Bug report
about: Report a problem with the app
title: "[BUG]"
labels: bug
assignees: ''

---

## Context

[provide more detailed introduction to the issue itself and why it is relevant]
Expand Down
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 💬 Community Support
url: //github.com/metacpan/metacpan-grep-front-end/discussions/
about: Please use GitHub Discussions for questions and support.
2 changes: 1 addition & 1 deletion .github/workflows/build-production-container.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build deployment container
name: Build production container
on:
push:
branches:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run testsuite for grep.metacpan

on:
push:
# branches: [ main ]
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
# Checkout the main repo
- name: Checkout current repo
uses: actions/checkout@v4
with:
path: main-repo

# Checkout the metacpan-cpan-extracted-lite repo
- name: Checkout CPAN repo
uses: actions/checkout@v4
with:
repository: metacpan/metacpan-cpan-extracted-lite
path: metacpan-cpan-extracted-lite
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup container
run: |
cd main-repo
make test-setup

# Set up Docker Compose
- name: Run tests
run: |
cd main-repo
make test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.DS_Store
.env
.tidyall.d
MYMETA.json
MYMETA.yml
Makefile
blib
local
pm_to_blib
Expand Down
75 changes: 0 additions & 75 deletions .travis.yml

This file was deleted.

52 changes: 48 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,53 @@
FROM metacpan/metacpan-base:latest
##
## Temporary image for installing metacpan packages
##

FROM metacpan/metacpan-base:latest AS builder
SHELL [ "/bin/bash", "-eo", "pipefail", "-c" ]

# copy the cpanfile and cpanfile.snapshot
# from the current directory to the /cpan directory in the image
# and install the dependencies using cpm
# we could then reuse the cpanfile and cpanfile.snapshot for testing
WORKDIR /cpan

COPY cpanfile ./
COPY cpanfile.snapshot ./

RUN <<EOT
cpm install -g \
--without-test \
--with-recommends \
--with-develop \
--cpanfile cpanfile
EOT

##
## Runtime image for metacpan-grep-front-end
##

FROM builder AS runtime
SHELL [ "/bin/bash", "-eo", "pipefail", "-c" ]

ADD . /metacpan-grep-front-end
WORKDIR /metacpan-grep-front-end

RUN cpm install --without-test -g
# Build arguments
ARG APP_ENV=development

# Runtime
ENV APP_ENV=$APP_ENV

# .dockerignore is used to exclude files from the build context
COPY src/ ./

# always expose a consistent port
EXPOSE 3000
# volume controlled by the docker-compose.yml
VOLUME [ "/metacpan-cpan-extracted" ]
CMD plackup -p 3000 ${GREP_PLACKUP_SERVER_ARGS} bin/app.psgi

# Make the entrypoint script executable
RUN chmod +x docker-entrypoint.sh

# Use the dynamic entrypoint
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["serve"]
24 changes: 0 additions & 24 deletions MANIFEST

This file was deleted.

17 changes: 0 additions & 17 deletions MANIFEST.SKIP

This file was deleted.

40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

.PHONY: all up-dev up-prod up test test-setup t

APP_ENV ?= development
DOCKER_ENV := $(if $(filter $(APP_ENV),test-setup),test,$(APP_ENV))

# Add overload config for docker-compose
ifeq ($(APP_ENV),development)
COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml
else ifeq ($(APP_ENV),test-setup)
COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml:docker-compose.test-setup.yml
else ifeq ($(APP_ENV),test)
COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml:docker-compose.test.yml
else
COMPOSE_FILE=docker-compose.yml
endif

all:
$(MAKE) up

up:
ln -sf config/docker-compose.$(DOCKER_ENV).env .env
APP_ENV=$(DOCKER_ENV) docker compose -f $(subst :, -f ,$(COMPOSE_FILE)) up --build --exit-code-from grep

up-dev:
$(MAKE) up APP_ENV=development

up-prod:
$(MAKE) up APP_ENV=production

t: test

test-setup:
$(MAKE) up APP_ENV=test-setup

test:
$(MAKE) up APP_ENV=test

bash:
docker exec -it grep-container /bin/bash
30 changes: 0 additions & 30 deletions Makefile.PL

This file was deleted.

Loading