Skip to content
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

refactor: v4 #1542

Draft
wants to merge 103 commits into
base: v4
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
bd6ed1e
draft: metrics engine
lowlighter Oct 5, 2023
3f990d4
feat(plugins/calendar): v4
lowlighter Oct 5, 2023
66898bd
feat(plugins/gists): v4
lowlighter Oct 5, 2023
e05c264
feat(plugins/introduction): v4
lowlighter Oct 5, 2023
b2df942
feat(plugins/rss): v4
lowlighter Oct 5, 2023
a1b1fc8
feat(plugins/webscraping): v4
lowlighter Oct 5, 2023
c9d55fa
feat(processors/assert): add support
lowlighter Oct 5, 2023
918e733
feat(processors/inject.content): add support
lowlighter Oct 5, 2023
510479b
feat(processors/inject.script): add support
lowlighter Oct 5, 2023
e6f2303
feat(processors/inject.style): add support
lowlighter Oct 5, 2023
2d061ff
feat(processors/optimize.css): add support
lowlighter Oct 5, 2023
71d837e
feat(processors/optimize.svg): add support
lowlighter Oct 5, 2023
d161d3e
feat(processors/optimize.xml): add support
lowlighter Oct 5, 2023
85e114a
feat(processors/publish.console): add support
lowlighter Oct 5, 2023
c8e5739
feat(processors/publish.file): add support
lowlighter Oct 5, 2023
a8884bf
feat(processors/publish.gist): add support
lowlighter Oct 5, 2023
ddb598c
feat(processors/publish.git): add support
lowlighter Oct 5, 2023
9d6fed5
feat(processors/render.gemojis): add support
lowlighter Oct 5, 2023
12c240c
feat(processors/render.octicons): add support
lowlighter Oct 5, 2023
e2c2346
feat(processors/render.twemojis): add support
lowlighter Oct 5, 2023
06b2897
feat(processors/render): add support
lowlighter Oct 5, 2023
3cde476
draft(run/action): add support
lowlighter Oct 5, 2023
28ab19a
draft(run/cli): add support
lowlighter Oct 5, 2023
b37611b
draft(run/server): add support
lowlighter Oct 5, 2023
11c4e2b
chore: flags and tests
lowlighter Oct 5, 2023
3330c23
refactor: move code to source/ and use deno kv for sessions
lowlighter Oct 5, 2023
0f1b5e0
feat: add secret to censor token from logs
lowlighter Oct 5, 2023
87dee1e
feat: statically analyzable dynamic imports for deno deploy
lowlighter Oct 5, 2023
6ca6977
chore: fmt
lowlighter Oct 5, 2023
7e8494f
fix: remove lock file for now
lowlighter Oct 5, 2023
93c83a1
server: continue implementation
lowlighter Oct 6, 2023
5149748
feat: btr-tasks
lowlighter Oct 10, 2023
43877b1
feat: improve deno config
lowlighter Oct 10, 2023
57a100a
feat: minor improvement and fmt
lowlighter Oct 10, 2023
fcf7641
feat: update the way to build static/app.js
lowlighter Oct 10, 2023
234e510
tests: no need to sanitize ops anymore
lowlighter Oct 10, 2023
3a04bab
feat(processors/control.delay): add support
lowlighter Oct 10, 2023
4ec8e62
ci: improve
lowlighter Oct 10, 2023
e580b60
feat: add `Dockerfile` draft
lowlighter Oct 10, 2023
a4acdc6
fix: lock-file
lowlighter Oct 10, 2023
5c58dfc
fix: ci
lowlighter Oct 10, 2023
4fe7372
fix: docker args for headless in docker
lowlighter Oct 10, 2023
0395484
fix(ci): forgot to pass env var
lowlighter Oct 10, 2023
8f7b41c
feat: engine improve
lowlighter Oct 12, 2023
d055c76
draft: action
lowlighter Oct 12, 2023
66a41de
Update action.yml
lowlighter Oct 12, 2023
8dc6e9a
Update action.yml
lowlighter Oct 12, 2023
23d1980
Update action.yml
lowlighter Oct 12, 2023
5f8bab9
action poc
lowlighter Oct 12, 2023
3fd3c91
Update action.yml
lowlighter Oct 12, 2023
ac3275c
continue
lowlighter Oct 12, 2023
3041728
continue
lowlighter Oct 19, 2023
8a0305c
fmt and lint
lowlighter Oct 19, 2023
006c60b
Update ci.yml
lowlighter Oct 19, 2023
6d7647f
continue
lowlighter Oct 19, 2023
e0d0d9d
Update ci.yml
lowlighter Oct 19, 2023
bc90d66
fix docker workflow maybe
lowlighter Oct 19, 2023
61c12df
continue
lowlighter Oct 19, 2023
cbb720f
Update ci.yml
lowlighter Oct 19, 2023
5e9fffd
continue
lowlighter Oct 20, 2023
7887dc7
stuff to test action
lowlighter Oct 20, 2023
1a4008e
action stuff
lowlighter Oct 20, 2023
9c1de26
move stuff and continue
lowlighter Oct 21, 2023
18e2cf6
continue + fixes
lowlighter Oct 24, 2023
032f3c3
feat: improve crafter
lowlighter Oct 27, 2023
22fa85d
continue
lowlighter Oct 28, 2023
3e79503
default value (partial)
lowlighter Oct 28, 2023
d7cfd16
continue publish.git
lowlighter Oct 29, 2023
9eb6237
continue stuff
lowlighter Oct 29, 2023
0f6de8b
continue and finish publish.git
lowlighter Oct 31, 2023
5d86df8
some extra coverage
lowlighter Oct 31, 2023
b550e07
god i hate timezones and dst so much
lowlighter Oct 31, 2023
0ac4242
fix issue with chromium
lowlighter Oct 31, 2023
00f404a
continue
lowlighter Nov 8, 2023
eda4257
continue compat layer
lowlighter Nov 9, 2023
6dde23b
ci
lowlighter Nov 9, 2023
ee40f59
fix some stuff
lowlighter Nov 9, 2023
94d92d5
Update Dockerfile
lowlighter Nov 9, 2023
93c8c28
typing change
lowlighter Nov 14, 2023
181e090
Update .gitignore
lowlighter Nov 14, 2023
7b45505
continue compat layer
lowlighter Nov 14, 2023
ce721c3
feat: add transform.base64 processor
lowlighter Nov 14, 2023
83af929
fmt
lowlighter Nov 14, 2023
cd4c9c0
continue and implement .legacy plugin
lowlighter Nov 15, 2023
22e6d19
d3 graphs in utils
lowlighter Nov 16, 2023
535f70a
finish graph and lines
lowlighter Nov 21, 2023
de6801c
add some documentations, change NOP to .await and add create component
lowlighter Nov 22, 2023
3b662ba
partial
lowlighter Nov 22, 2023
a2da01d
acitivity plugin draft
lowlighter Nov 23, 2023
efe156b
acitivity plugin draft
lowlighter Nov 23, 2023
08e8822
continue
lowlighter Nov 24, 2023
689b462
continue
lowlighter Nov 24, 2023
04d69fd
continue client
lowlighter Nov 24, 2023
f0c2cc2
dmt
lowlighter Nov 24, 2023
8bb9d18
Delete test.ts
lowlighter Nov 24, 2023
be78a61
fix
lowlighter Nov 24, 2023
8122c4c
continue with docs and compatibility migration helper on web ui
lowlighter Nov 25, 2023
a7a7e88
Update deno.jsonc
lowlighter Nov 25, 2023
6a16157
continue
lowlighter Nov 27, 2023
3f1b29c
Update mod.ts
lowlighter Nov 27, 2023
80758cf
continue client
lowlighter Dec 5, 2023
586474a
continue
lowlighter Dec 17, 2023
3af9fa0
continue
lowlighter Dec 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Auto detect text files and perform LF normalization
* text=auto

# TODO(@lowlighter): linguist-attributes
# Hidden files
.github/** -linguist-detectable

# Documentation
CODE_OF_CONDUCT.md linguist-documentation
CONTRIBUTING.md linguist-documentation
SECURITY.md linguist-documentation
README.md linguist-documentation
LICENSE linguist-documentation

# Generated files
deno.lock linguist-generated
67 changes: 52 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
name: Continuous integration
name: Metrics
on:
push:
branches:
- v4
pull_request:
branches:
- v4
- v4-dev
#pull_request:
# branches:
# - v4-dev
# paths-ignore:
# - "**/*.md"
jobs:
# Lint, format, build and test
testing:
runs-on: ubuntu-latest
strategy:
matrix:
task:
- lint
- fmt --check
- test
- ci:lint
- ci:test
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
- run: deno task ${{ matrix.task }}
- run: deno task make ${{ matrix.task }}

# GitHub CodeQL analysis
analyze:
runs-on: ubuntu-latest
needs:
Expand All @@ -31,14 +36,46 @@ jobs:
fail-fast: false
matrix:
language:
- javascript-typescript
- typescript
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: security-and-quality
config: |
queries:
- uses: security-and-quality
paths-ignore:
- source/run/serve/imported.ts
- uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"

# Build and push Docker image
docker:
if: github.ref == 'refs/heads/v4-dev'
runs-on: ubuntu-latest
needs:
- analyze
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
if: github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@v5
with:
context: .
tags: ghcr.io/${{ github.repository }}:v4
push: ${{ github.event_name == 'push' }}

# Test GitHub Action
github-action:
runs-on: ubuntu-latest
needs:
- docker
steps:
- uses: lowlighter/metrics@v4-dev
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.deno-make.json
.cache
.coverage
.env
.secrets
.test
.kv
.kv-*
node_modules
metrics.config.yml

# TODO(@lowlighter): remove after migration
.legacy
settings.json
source/run/serve/static/app.js
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# 🏗️ We're working on it !

<!-- TODO(@lowlighter): write contributing guide -->
71 changes: 71 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Metrics docker image
FROM alpine:3.18
RUN apk upgrade --no-cache --available

# Install sudo
RUN apk add --update --no-cache sudo \
&& echo 'metrics ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/metrics

# Install licensed
RUN apk add --no-cache ruby \
&& apk add --no-cache --virtual .licensed ruby-dev make cmake g++ heimdal-dev \
&& gem install licensed \
&& apk del .licensed \
&& licensed --version

# Install chromium
ENV CHROME_BIN /usr/bin/chromium-browser
ENV CHROME_PATH /usr/lib/chromium/
ENV CHROME_EXTRA_FLAGS "--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage"
RUN apk add --no-cache chromium ttf-freefont font-noto-emoji \
&& apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community font-wqy-zenhei \
&& chromium --version

# Install docker
RUN apk add --update --no-cache docker-cli \
&& addgroup docker \
&& docker --version

# Install deno
ENV DENO_INSTALL /
ENV DENO_NO_UPDATE_CHECK true
ENV DENO_VERSION 1.38.3
ENV GLIBC_VERSION 2.34-r0
RUN apk add --no-cache --virtual .deno curl wget unzip \
&& wget --no-hsts --quiet --output-document /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget --no-hsts --quiet https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk \
&& wget --no-hsts --quiet https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk \
&& wget --no-hsts --quiet https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-i18n-${GLIBC_VERSION}.apk \
&& mv /etc/nsswitch.conf /etc/nsswitch.conf.bak \
&& apk add --no-cache --force-overwrite glibc-${GLIBC_VERSION}.apk glibc-bin-${GLIBC_VERSION}.apk glibc-i18n-${GLIBC_VERSION}.apk \
&& mv /etc/nsswitch.conf.bak /etc/nsswitch.conf \
&& (/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true) \
&& (echo "export LANG=$LANG" > /etc/profile.d/locale.sh) \
&& rm /etc/apk/keys/sgerrand.rsa.pub glibc-${GLIBC_VERSION}.apk glibc-bin-${GLIBC_VERSION}.apk glibc-i18n-${GLIBC_VERSION}.apk \
&& apk del glibc-i18n \
&& (curl -fsSL https://deno.land/x/install/install.sh | sh) \
&& apk del .deno \
&& deno upgrade --version ${DENO_VERSION} \
&& deno --version

# Install lighthouse
RUN apk add --no-cache npm \
&& npm install --global lighthouse \
&& lighthouse --version

# General configuration
RUN apk add --no-cache git \
&& adduser --system metrics \
&& addgroup metrics docker

# Metrics
USER metrics
WORKDIR /metrics
ENV TZ Europe/Paris
ENV TMP /tmp
COPY source /metrics/source
COPY deno.jsonc /metrics/deno.jsonc
COPY LICENSE /metrics/LICENSE
RUN deno task make cache
RUN deno task make get:browser
ENTRYPOINT [ "deno", "task", "make", "run", "github-action" ]