Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4565069
Phase 1-2: Foundation, build system, and non-conflicting upstream add…
Copilot Apr 30, 2026
d901d18
Phase 3+5: Merge core models (filemodels, foldermodels, mixins, image…
Copilot Apr 30, 2026
602b3f4
Phase 4+6+7: Merge admin, fields, and utilities with PBS customizatio…
Copilot Apr 30, 2026
848acee
Phase 8: Generate migration 0008 for upstream schema changes (Thumbna…
Copilot Apr 30, 2026
ea8f300
Phase 9-10: Adopt upstream templates/static/locale, fix import issues…
Copilot Apr 30, 2026
8efb149
Remove accidentally committed test.zip
Copilot Apr 30, 2026
2a29e5e
BEN-2954: fix test error
Apr 30, 2026
fac8419
BEN-2954: fix tests
Apr 30, 2026
d140d5b
BEN-2954: more test fixes
Apr 30, 2026
1d8f171
BEN-2954: PBS fixes
Apr 30, 2026
f2283df
BEN-2954: set version 3.4.4
Apr 30, 2026
ae5bf9d
BEN-2954: fix cdn
Apr 30, 2026
649d9a0
Merge branch 'BEN-3407' into BEN-2954
May 15, 2026
15bea78
Merge branch 'master_pbs' into BEN-2954
May 28, 2026
77b78d8
BEN-2954: use bento3 patch versioning
May 28, 2026
857efaa
Ben-2954: test
May 28, 2026
cca5ae4
BEN-2954: font awesome upgrade and debug
May 28, 2026
e23579a
BEN-2954: fix new line error
Jun 8, 2026
d7cd0c5
BEN-2954: fix tests
Jun 8, 2026
d29f4a6
BEN-2954: test
Jun 8, 2026
78dd965
BEN-2954: fix clipboard
Jun 8, 2026
98d367e
BEN-2954: fix dropzone
Jun 8, 2026
6d8486a
BEN-2954: use filer tree
Jun 8, 2026
6ff4b23
BEN-2954: extract zip files check
Jun 9, 2026
ff064cb
BEN-2954: remove clipboard
Jun 9, 2026
53de0b6
BEN-2954: filer archive model added
Jun 9, 2026
f504aef
BEn-2954: test archive and browser reload after drag file upload
Jun 9, 2026
45a4d02
BEN-2954: debug logs added
Jun 9, 2026
5964cd5
BEN-2954: test
Jun 9, 2026
8ab90d4
BEN-2954: debug
Jun 9, 2026
13ec1b9
BEN-2954: test
Jun 9, 2026
a92d981
BEN-2954: setup.py removed
Jun 9, 2026
badec15
BEN-2954: remove logs
Jun 9, 2026
8abf6c6
BEN-2954: fix file uploads and edit
Jun 10, 2026
c52912f
BEN-2954: rename filer versions
Jun 10, 2026
bed9d6d
BEN-2954: add button
Jun 10, 2026
dc8739a
BEN-2954: test upload
Jun 10, 2026
5e8e393
BEN-2954: bump-my-version added and configed with makefile
Jun 11, 2026
3deb34f
BEN-2954: fix version in .bumpversion.toml
Jun 11, 2026
913a81a
BEN-2954: use short sha
Jun 11, 2026
ea07107
BEN-2954: nexus publish commands
Jun 11, 2026
7f83356
BEN-2954: fix makefile for second prekind bump version
Jun 11, 2026
1c4c079
BEN-2954: fix prekind second attempt from a different github hash
Jun 11, 2026
68a0189
BEN-2954: debug file upload
Jun 11, 2026
b0545da
BEN-2954: use sha param when executed from GHA in order to create pac…
Jun 11, 2026
a5e264f
BEN-2954: use print
Jun 11, 2026
c52b9ba
BEN-2954: fix stale clipboard
Jun 11, 2026
0c382f2
BEN-2954: remove debug logs
Jun 11, 2026
840997d
BEN-2954: lazy load folder tree
Jun 11, 2026
a1ba3a6
BEN-2954: fallback improved
Jun 15, 2026
df51be8
BEN-2954: make uploads looser due to pillow limitations
Jun 16, 2026
b8be6e2
BEN-2954: role restriction
Jun 16, 2026
4811f1f
BEN-2954: developer guide readme
Jun 17, 2026
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
35 changes: 35 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tool.bumpversion]
current_version = "3.4.4+pbs.1"
commit = false
tag = false
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.
(?P<patch>0|[1-9]\\d*)
\\+pbs\\.
(?P<pbs>0|[1-9]\\d*)
(?:
\\.(?P<prekind>dev)
\\.g[0-9a-f]{7,40}
\\.\\d{8}
)?
"""

serialize = [
"{major}.{minor}.{patch}+pbs.{pbs}.{prekind}.g{$GITHUB_SHA}.{now:%Y%m%d}",
"{major}.{minor}.{patch}+pbs.{pbs}"
]


[tool.bumpversion.parts.prekind]
values = [
"",
"dev"
]
optional_value = ""


[[tool.bumpversion.files]]
filename = "filer/__init__.py"
search = "{current_version}"
replace = "{new_version}"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.installed.cfg
bin
develop-eggs
dist
/dist
downloads
eggs
parts
Expand All @@ -14,6 +14,7 @@ tmp
*.egg
.DS_Store
.sass-cache
node_modules
.project
.pydevproject
.settings
Expand Down
56 changes: 46 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,68 @@ help: ## This help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help

.PHONY: bump-pbs bump-prekind build publish-nexus publish-nexus-dry-run

IMAGE_NAME := django-filer-test
CONTAINER_NAME := django-filer-test-run
SHELL:=/bin/bash

## Build the test Docker image
test-build:
test-build: ## Build the test Docker image
docker build -f Dockerfile.test -t $(IMAGE_NAME) .

## Run unit tests in a Docker container
test:
test: ## Run unit tests in a Docker container
@if [ -z "$$(docker images -q $(IMAGE_NAME) 2>/dev/null)" ]; then \
echo "Image not found, building..."; \
$(MAKE) test-build; \
fi
docker run --rm --name $(CONTAINER_NAME) $(IMAGE_NAME)

## Run tests with verbose output and stop on first failure
test-verbose: test-build
test-verbose: test-build ## Run tests with verbose output and stop on first failure
docker run --rm --name $(CONTAINER_NAME) $(IMAGE_NAME) \
pytest -vx --ds=filer.test_settings --pyargs filer.tests

## Open a shell in the test container (useful for debugging)
test-shell: test-build
test-shell: test-build ## Open a shell in the test container (useful for debugging)
docker run --rm -it --name $(CONTAINER_NAME) $(IMAGE_NAME) /bin/bash

## Remove the test Docker image
test-clean:
test-clean: ## Remove the test Docker image
-docker rmi $(IMAGE_NAME)


bump-pbs: ## Bump PBS number: 3.4.4+pbs.3 -> 3.4.4+pbs.4
bump-my-version bump --allow-dirty pbs

bump-prekind: ## Bump prekind dev version: 3.4.4+pbs.3 -> 3.4.4+pbs.3.dev.g<sha>.YYYYMMDD. Pass sha=<commit> to override.
@current=$$(grep "^__version__" filer/__init__.py | sed "s/^__version__ = '//;s/'.*//"); \
sha="$${sha:-$$(git rev-parse --short=8 HEAD)}"; \
sha8="$${sha:0:8}"; \
if echo "$$current" | grep -q '\.dev\.'; then \
current_sha=$$(echo "$$current" | sed -nE "s/.*\.dev\.g([0-9a-f]{7,40})\.[0-9]{8}/\1/p"); \
current_sha8="$${current_sha:0:8}"; \
if [ "$$current_sha8" = "$$sha8" ]; then \
echo "Nothing to bump: '$$current' already targets commit '$$sha8'. Create a new commit first or run 'make bump-pbs'."; \
exit 1; \
fi; \
base=$$(echo "$$current" | sed -E "s/\.dev\.g[0-9a-f]+\.[0-9]{8}$$//"); \
new_version="$$base.dev.g$$sha8.$$(date +%Y%m%d)"; \
else \
base="$$current"; \
new_version="$$base.dev.g$$sha8.$$(date +%Y%m%d)"; \
fi; \
echo "Bumping: $$current -> $$new_version"; \
sed -i.bak "s/__version__ = '$$current'/__version__ = '$$new_version'/" filer/__init__.py && rm -f filer/__init__.py.bak; \
sed -i.bak -E "s/^current_version = \"[^\"]+\"/current_version = \"$$new_version\"/" .bumpversion.toml && rm -f .bumpversion.toml.bak


build: ## Build distribution packages (sdist and wheel)
rm -rf dist/ build/ *.egg-info
python3 -m pip install --upgrade --break-system-packages build
python3 -m build

publish-nexus: build ## Publish to Nexus using ~/.pypirc config
python3 -m pip install --upgrade --break-system-packages twine
python3 -m twine upload -r nexus dist/*

publish-nexus-dry-run: build ## Validate packages ready for Nexus (without uploading)
python3 -m pip install --upgrade --break-system-packages twine
python3 -m twine check dist/*

150 changes: 150 additions & 0 deletions README_PBS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# PBS Fork – Developer Guide

## Versioning Scheme

This fork uses a PBS-specific versioning scheme:

```
<upstream_version>+pbs.<pbs_number>
```

Example: `3.4.4+pbs.1`, `3.4.4+pbs.2`

Development (pre-release) versions append a dev suffix:

```
<upstream_version>+pbs.<pbs_number>.dev.g<commit_sha>.YYYYMMDD
```

Example: `3.4.4+pbs.1.dev.g1a2b3c4d.20260617`

The version is stored in `filer/__init__.py` and read dynamically by `pyproject.toml`.

---

## Makefile Targets

Run `make help` to see all available targets. Summary:

| Target | Description |
|--------|-------------|
| `make help` | Show all available targets |
| `make test-build` | Build the test Docker image |
| `make test` | Run unit tests in a Docker container (builds image if missing) |
| `make test-verbose` | Run tests with verbose output, stop on first failure |
| `make test-shell` | Open a shell in the test container (for debugging) |
| `make test-clean` | Remove the test Docker image |
| `make bump-pbs` | Bump the PBS version number (e.g. `+pbs.1` → `+pbs.2`) |
| `make bump-prekind` | Create a dev pre-release version from the current commit |
| `make build` | Build sdist and wheel packages into `dist/` |
| `make publish-nexus` | Build and upload packages to Nexus |
| `make publish-nexus-dry-run` | Build and validate packages without uploading |

---

## How to Publish a New Version

### Prerequisites

- Python 3 installed
- `bump-my-version` installed (`pip install bump-my-version`)
- `~/.pypirc` configured with a `[nexus]` section containing your repository URL and credentials

### Steps

#### 1. Run tests

```bash
make test
```

Ensure all tests pass before proceeding.

#### 2. Bump the PBS version

```bash
make bump-pbs
```

This increments the PBS number (e.g. `3.4.4+pbs.1` → `3.4.4+pbs.2`) in both `filer/__init__.py` and `.bumpversion.toml`.

#### 3. Commit and push

```bash
git add filer/__init__.py .bumpversion.toml
git commit -m "Bump to $(grep __version__ filer/__init__.py | sed "s/.*'//;s/'.*//")"
git push
```

#### 4. Publish to Nexus

```bash
make publish-nexus
```

This will:
1. Clean previous build artifacts
2. Build source distribution and wheel (`python3 -m build`)
3. Upload to Nexus using `twine` with the `[nexus]` section from `~/.pypirc`

#### 5. (Optional) Validate without uploading

```bash
make publish-nexus-dry-run
```

Runs `twine check` on the built packages to verify they are well-formed.

---

## Publishing a Dev (Pre-release) Version

Use this when you need to test unreleased changes without a formal PBS bump:

```bash
make bump-prekind
```

This creates a version like `3.4.4+pbs.1.dev.g1a2b3c4d.20260617` based on the current HEAD commit and date.

You can override the commit SHA:

```bash
make bump-prekind sha=abc12345
```

Then publish normally:

```bash
make publish-nexus
```

> **Note:** To bump again on the same commit, you must first run `make bump-pbs` to move to the next PBS number.

---

## Publishing via GitHub Actions (Bento3)

You can also publish a new version using the **bento3** GitHub Actions workflow:

🔗 [publish_django_filer.yml](https://github.com/pbs-digital/bento3/actions/workflows/publish_django_filer.yml)

Trigger the workflow manually from the Actions tab. This is the recommended approach for CI-driven releases.

---

## `~/.pypirc` Configuration (for local publishing)

Ensure your `~/.pypirc` contains a `[nexus]` entry:

```ini
[distutils]
index-servers =
nexus

[nexus]
repository = https://your-nexus-instance/repository/pypi-hosted/
username = your-username
password = your-password-or-token
```

Loading