Skip to content

Commit 6658bc8

Browse files
jagalindojmhorcassebasruii
authored
New version with Z3 support among other changes (#44)
* Feature: Add language level to FM information * Update flamapy to pre-release * Feature: Add Attribute Optimization operation * Fix: attribute optimization * Update plugins * fix: Update fixed z3 package * feat: Add new z3 plugin version * fix: Serialize attributes * updating to enable collaboration between multiple users * enabled collaboration * feat: updating icon arrangement and viz improvements * feat: merge views/analytics/horcas/collab into develop - Toolbar-less layout: controls injected into Navbar via setNavControls - Plugin config system: public/flamapy/plugins.conf.json drives which wheels micropip installs and which solver tabs the UI shows; Z3 disabled by default - Solver tabs (SAT/BDD/Z3) now derived from config loaded by the worker on startup - New views: Config. Distribution and Feature Prob. charts (from views branch) using react-chartjs-2; BDD-backed Python functions in flamapy_ide.py - Z3 support: attribute optimization modal, getNumericalAttributes worker action - Collaborative editing: yjs + y-websocket, gated on VITE_ENABLE_COLLAB=true - Analytics: GA4 with cookie consent, Privacy Policy and Cookie Preferences pages - Makefile: add build-wheels target to download pure-python wheels from PyPI - Remove leftover EditorPage copy files * feat: improve UI, fix FIP output, upgrade wheels to 2.5.0 - Toolbar: add Metrics dropdown (Config Distribution, Feature Prob.) inline with View section; remove standalone Configurator section - DropdownMenu: use minWidth so option text is never clipped - ModelProperties: remove FM Fact Label link - flamapy_ide.py: fix BDDFeatureInclusionProbability printing [object Object] by serializing plain dicts to string list - Makefile: add clean-old-wheels target (reads plugins.conf.json as source of truth); runs automatically after build-wheels - .gitignore: ignore CLAUDE.md, .claude/, .env, .env.example - Wheels: upgrade all flamapy packages to 2.5.0, dd to 0.6.0; remove stale 2.1.0.dev0 wheels, flamapy_bdd_colosal, and Linux z3 wheel * fix: high-priority improvements across CI, tests, and UX - Tests: fix silent assertions in test_get_model_information (missing assert keywords and accidental assignments instead of comparisons) - CI: add ESLint workflow that runs on PRs to main and pushes to develop - CI: fix Docker workflow — guard both jobs with 'conclusion == success' so a failed release-please does not trigger a build or deploy - CI: bump Python to 3.12 to match Pyodide runtime; install vendored flamapy_configurator wheel; add --cov flag to pytest - UX: persist editor content to localStorage on every edit and restore it on startup when no file is being imported; skipped during collab sessions to avoid cross-session bleed * fix: set minimum Python version to 3.11 * feat: implement all medium and low priority improvements Medium priority: - Graph view: explicitly re-fetch feature tree on every switch to graph, ensuring the visualization is always in sync with the current model - Tests: add coverage for get_configuration_distribution, get_feature_inclusion_probabilities, and BDDFeatureInclusionProbability dict serialization path - Error boundaries: add ErrorBoundary component wrapping chart views so a render crash does not take down the whole editor - Metrics charts: add Download PNG button to Config Distribution and Feature Inclusion Probabilities charts via chartjs toBase64Image Low priority: - URL model sharing: ?model=<base64> query param loads a model on startup (priority over localStorage); Share section in toolbar copies the link - UVL autocomplete: Monaco snippet completions for all UVL keywords (namespace, features, constraints, mandatory, optional, alternative, or) - Keyboard navigation in DropdownMenu: ArrowUp/Down to move focus, Enter to select, Escape to close; ARIA roles updated to listbox/option - Dark mode: Tailwind darkMode:'class', toggle button in Navbar (persisted to localStorage), dark variants on Navbar, toolbar, output panel, model info panel, and dropdown menu * fix: dark mode toggle and ESLint vendor file exclusion - Exclude public/ from ESLint to prevent vendor files (pyodide, flamapy) from causing lint failures in CI - Wire darkMode prop from App → EditorPage → UVLEditor so Monaco editor switches between vs/vs-dark themes when the toggle is clicked * fix: add dark mode classes across all editor UI components Cover the remaining components that were displaying light-only colors: FeatureTree panel/nodes, Wizzard container, ModelProperties text/dividers, Configuration feature lists, toolbar buttons (solver/analysis/export/metrics/collab), hide/show panel buttons, Z3 optimization modal, and the UVLEditor wrapper div. * chore: update dependencies, fix wheel install indentation, and ignore start_coding.sh - Add chart.js, js-cookie, react-chartjs-2, react-cookie-consent, react-ga4 to package-lock.json - Update esbuild to 0.27.3 - Fix micropip.install indentation in flamapy.js - Add start_coding.sh to .gitignore * chore: commit remaining working tree changes for develop sync - webworker.js: pass msgId in postMessage responses, simplify context destructuring - requirements.txt: update to flamapy 2.5.0, add z3, fix configurator install note - FeatureModelVisualization.jsx: replace dom-to-svg with native XMLSerializer for SVG export - Normalize file modes and binary assets to match working environment * fix: prevent flamapy-configurator wheel from downgrading flamapy-fm/fw The vendored flamapy_configurator-2.0.1-py3-none-any.whl requires flamapy-fw~=2.0.1 and flamapy-fm~=2.0.0, causing pip to downgrade those packages from 2.5.0. This removed FMLanguageLevel from flamapy-fm, breaking all test collection with an ImportError. - Use --no-deps when installing the configurator wheel so 2.5.0 packages stay in place - Also upgrade setuptools and wheel alongside pip to avoid astutils/ply build failures on older setuptools versions - Fix BDDVariantFeatures test to use order-independent comparison since the BDD operation returns features in non-deterministic order * fix: resolve all ESLint errors and warnings blocking lint CI - Add node env override in .eslintrc.cjs for server/ files so process is recognised without explicit global declarations - Remove stale eslint-disable comments (no-console in collab-server, no-unused-vars in EditorPage) that were flagged as unused directives - Add PropTypes for Configuration, ErrorBoundary, FeatureInclusionProbabilitiesChart, Information, ProductDistributionChart - Remove unused React import from FeatureInclusionProbabilitiesChart and ProductDistributionChart (jsx-runtime transform makes it unneeded) - Add missing useEffect deps: availableWidth in FeatureModelVisualization, type in Information; suppress intentional once-on-mount effect in Home - Fix no-useless-escape in UVLEditor regex character classes - Remove unused cancelURL variable from Wizzard - Remove unused importURL state from Home * fix: Update menu button size * Feat: New feature flow map visualization for attributes * Feature: Pareto Front viz for Attr. Opt. with Z3 * chore: Update deps * chore: Update deps * feat: Import model to UVLHub * fix: Add model.uvl so that UVLHub can understand the endpoint * fix: Correct dark mode styling on some components * fix: Correct collab button style * feat: modification to host the ide in github pages automatically. Only client side features will be available by now. * feat: updating the mechanism to get the wheels. It now self checks fro new flamapy versions and retrieves the wheels * fix: retrieving flamapy wheels from its releases * fix: solving linting errors * fix: regenerate flamapy wheels in the test workflow --------- Co-authored-by: José Miguel Horcas <horcas@uma.es> Co-authored-by: sebasruii <fsbrd10@gmail.com>
1 parent bfa9682 commit 6658bc8

104 files changed

Lines changed: 5172 additions & 1316 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

100644100755
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ module.exports = {
77
'plugin:react/jsx-runtime',
88
'plugin:react-hooks/recommended',
99
],
10-
ignorePatterns: ['dist', '.eslintrc.cjs'],
10+
ignorePatterns: ['dist', '.eslintrc.cjs', 'public/', 'nginx/'],
11+
overrides: [
12+
{
13+
files: ['server/**/*.js', 'vite.config.js'],
14+
env: { node: true },
15+
},
16+
],
1117
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
1218
settings: { react: { version: '18.2' } },
1319
plugins: ['react-refresh'],

.github/workflows/deploy-pages.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: npm
27+
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.11"
31+
32+
- name: Configure Pages
33+
id: pages
34+
uses: actions/configure-pages@v5
35+
36+
- run: npm ci
37+
38+
# The flamapy wheels served to the browser are not tracked in git (see
39+
# .gitignore); regenerate them from flamapy.version before the build so
40+
# Vite copies them into dist/.
41+
- name: Build flamapy wheels
42+
run: make build-wheels
43+
44+
- name: Build
45+
env:
46+
VITE_BASE_PATH: ${{ steps.pages.outputs.base_path }}/
47+
run: npm run build
48+
49+
- name: SPA fallback
50+
run: cp dist/index.html dist/404.html
51+
52+
- uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: dist
55+
56+
deploy:
57+
needs: build
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
steps:
63+
- id: deployment
64+
uses: actions/deploy-pages@v4

.github/workflows/docker-image.yml

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
build-and-publish:
1010
runs-on: ubuntu-latest
11+
if: github.event.workflow_run.conclusion == 'success'
1112

1213
steps:
1314
- name: Checkout the code
@@ -33,6 +34,7 @@ jobs:
3334
3435
deploy:
3536
runs-on: ubuntu-latest
37+
if: github.event.workflow_run.conclusion == 'success'
3638

3739
steps:
3840
- name: Deploy

.github/workflows/lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- develop
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run ESLint
29+
run: npm run lint

.github/workflows/pytest.yaml

100644100755
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,25 @@ jobs:
1616
- name: Set up Python
1717
uses: actions/setup-python@v5
1818
with:
19-
python-version: "3.10"
19+
python-version: "3.11"
20+
21+
# The flamapy wheels served to the browser are not tracked in git (see
22+
# .gitignore); regenerate them from flamapy.version so the tests run
23+
# against the same artifacts the browser loads.
24+
- name: Build flamapy wheels
25+
run: make build-wheels
2026

2127
- name: Install dependencies
2228
run: |
23-
python -m pip install --upgrade pip
29+
python -m pip install --upgrade pip setuptools wheel
30+
# Install the exact flamapy wheels served to the browser (not a PyPI
31+
# pin), so the tests run against the shipped artifacts. The z3_solver
32+
# wheel is WASM-only and cannot install natively, so it is excluded;
33+
# the native z3-solver comes from requirements.txt instead.
34+
pip install --no-deps $(ls public/flamapy/*.whl | grep -v 'wasm')
35+
# Native solver backends + test tooling (python-sat, z3-solver, pytest).
2436
pip install -r requirements.txt
2537
2638
- name: Run tests
2739
run: |
28-
pytest
40+
pytest --cov=public tests/

.github/workflows/release-please.yml

100644100755
File mode changed.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Update flamapy wheels
2+
3+
# Keeps the flamapy-authored wheels in public/flamapy/ in sync with the flamapy
4+
# release pinned in ./flamapy.version. Runs whenever that file changes and on
5+
# demand; opens a pull request whenever the bundle changes. Third-party deps and
6+
# the z3_solver wasm wheel are not touched (use `make build-wheels` for those).
7+
on:
8+
push:
9+
paths:
10+
- "flamapy.version"
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
jobs:
18+
update:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.11"
26+
27+
- name: Update flamapy wheels from the latest release
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: python scripts/update_flamapy_wheels.py
31+
32+
- name: Open a pull request with the refreshed wheels
33+
uses: peter-evans/create-pull-request@v6
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
branch: chore/update-flamapy-wheels
37+
delete-branch: true
38+
title: "chore: update flamapy wheels to the pinned release"
39+
commit-message: "chore: sync flamapy wheels with the pinned flamapy release"
40+
body: |
41+
Automated update of the flamapy-authored wheels in `public/flamapy/`
42+
from the [flamapy release](https://github.com/flamapy/flamapy/releases)
43+
pinned in `flamapy.version`.
44+
45+
Refreshed `flamapy`, `flamapy-fw`, `flamapy-fm`, `flamapy-sat`,
46+
`flamapy-bdd` and `flamapy-z3`, and rewrote the matching filenames in
47+
`plugins.conf.json`. Third-party dependencies and the `z3_solver`
48+
wasm wheel are unchanged.
49+
50+
> Note: PRs opened with the default `GITHUB_TOKEN` do not trigger
51+
> other workflows. Push an empty commit or re-open the PR to run CI.
52+
add-paths: |
53+
public/flamapy/*.whl
54+
public/flamapy/plugins.conf.json

.gitignore

100644100755
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,26 @@ dist-ssr
2424
*.sw?
2525
.venv
2626
*/__pycache__
27-
*/*/__pycache__
27+
*/*/__pycache__
28+
29+
env/
30+
31+
# Claude Code
32+
CLAUDE.md
33+
.claude/
34+
35+
# Local environment variables
36+
.env
37+
.env.example
38+
39+
# start_coding.sh local environments
40+
start_coding.sh
41+
42+
# Flamapy wheels served to the browser are build artifacts: they are
43+
# regenerated by `make build-wheels` (versions from flamapy.version + the
44+
# Makefile dep list) and the deploy pipelines rebuild them before bundling, so
45+
# they are not tracked. The two wheels below are manually vendored and have no
46+
# PyPI/release-bundle source, so they MUST stay tracked.
47+
public/flamapy/*.whl
48+
!public/flamapy/flamapy_configurator-*.whl
49+
!public/flamapy/z3_solver-*.whl

CHANGELOG.md

100644100755
File mode changed.

Dockerfile

100644100755
Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,26 @@ EXPOSE 5173
2525
# Start the Vite development server
2626
CMD ["npm", "run", "dev", "--", "--host"]
2727

28-
# Stage 3: Production Build
28+
# Stage 3: Regenerate the flamapy wheels served to the browser.
29+
# These wheels are not tracked in git (see .gitignore); `make build-wheels`
30+
# rebuilds them from flamapy.version + the Makefile dep list. The two manually
31+
# vendored wheels (flamapy-configurator, z3_solver wasm) are copied in from the
32+
# build context, which `make build-wheels` leaves untouched.
33+
FROM python:3.11 AS wheels
34+
WORKDIR /app
35+
COPY Makefile flamapy.version ./
36+
COPY public/flamapy ./public/flamapy
37+
RUN make build-wheels
38+
39+
# Stage 4: Production Build
2940
FROM base AS build
3041

3142
# Set environment to production
3243
ENV NODE_ENV=production
3344

45+
# Pull in the regenerated wheels so Vite copies them into dist/
46+
COPY --from=wheels /app/public/flamapy ./public/flamapy
47+
3448
# Build the app
3549
RUN npm run build
3650

@@ -43,9 +57,12 @@ ENV NODE_ENV=production
4357
# Copy built files from the build stage
4458
COPY --from=build /app/dist /usr/share/nginx/html
4559

46-
# Copy custom Nginx configuration, if needed (optional)
60+
# Copy custom Nginx configuration
4761
COPY nginx.conf /etc/nginx/nginx.conf
4862

63+
# Copy njs script for the /raw endpoint (UVLHub integration)
64+
COPY nginx/raw.js /etc/nginx/njs/raw.js
65+
4966
# Expose port 80 for the Nginx server
5067
EXPOSE 80
5168

0 commit comments

Comments
 (0)