Skip to content

Commit 288e395

Browse files
committed
[Path] Remove deprecated "default_file", "default_link" and "default_directory" filters
1 parent 428fa56 commit 288e395

9 files changed

Lines changed: 124 additions & 168 deletions

File tree

.github/workflows/_lint.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
debug:
5+
type: boolean
6+
required: false
7+
default: false
8+
collection:
9+
type: string
10+
required: true
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-24.04
16+
steps:
17+
18+
- name: Checkout
19+
uses: actions/checkout@v6
20+
21+
- name: Set up system
22+
uses: ./.manala/github/system/setup
23+
24+
- name: Lint
25+
uses: ./.manala/github/system/run
26+
with:
27+
run: |
28+
cd ${{ inputs.collection }}
29+
make lint VERBOSE=1
30+
31+
- name: Debug
32+
uses: mxschmitt/action-tmate@v3
33+
if: ${{ inputs.debug && always() }}
34+
timeout-minutes: 15

.github/workflows/_test.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
debug:
5+
type: boolean
6+
required: false
7+
default: false
8+
collection:
9+
type: string
10+
required: true
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-24.04
16+
steps:
17+
18+
- name: Checkout
19+
uses: actions/checkout@v6
20+
21+
- name: Set up system
22+
uses: ./.manala/github/system/setup
23+
24+
- name: Test - Sanity
25+
uses: ./.manala/github/system/run
26+
with:
27+
run: |
28+
cd ${{ inputs.collection }}
29+
make test.sanity VERBOSE=1
30+
31+
- name: Test - Units
32+
uses: ./.manala/github/system/run
33+
with:
34+
run: |
35+
cd ${{ inputs.collection }}
36+
make test.units VERBOSE=1
37+
38+
- name: Test - Integration
39+
uses: ./.manala/github/system/run
40+
with:
41+
run: |
42+
cd ${{ inputs.collection }}
43+
make test.integration VERBOSE=1
44+
45+
- name: Test - Doc
46+
uses: ./.manala/github/system/run
47+
with:
48+
run: |
49+
cd ${{ inputs.collection }}
50+
make test.doc VERBOSE=1
51+
52+
- name: Debug
53+
uses: mxschmitt/action-tmate@v3
54+
if: ${{ inputs.debug && always() }}
55+
timeout-minutes: 15

.github/workflows/path.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Path
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .manala.yaml
7+
- .github/workflows/_lint.yaml
8+
- .github/workflows/_test.yaml
9+
- .github/workflows/path.yaml
10+
- path/**
11+
workflow_dispatch:
12+
inputs:
13+
debug:
14+
type: boolean
15+
description: Run with tmate debugging
16+
required: false
17+
default: false
18+
19+
jobs:
20+
path_lint:
21+
name: Lint
22+
uses: ./.github/workflows/_lint.yaml
23+
with:
24+
debug: ${{ inputs.debug == true }}
25+
collection: path
26+
path_test:
27+
name: Test
28+
uses: ./.github/workflows/_test.yaml
29+
with:
30+
debug: ${{ inputs.debug == true }}
31+
collection: path

path/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Removed
11+
12+
- Remove deprecated "default_file", "default_link" and "default_directory" filters
13+
1014
## [1.9.0] - 2025-12-12
1115

1216
### Added

path/meta/runtime.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
---
22

33
requires_ansible: '>=2.16.0'
4-
5-
plugin_routing:
6-
filter:
7-
default_file:
8-
deprecation:
9-
removal_version: 2.0.0
10-
warning_text: Use "default" filter with state='file' instead.
11-
default_link:
12-
deprecation:
13-
removal_version: 2.0.0
14-
warning_text: Use "default" filter with state='link' instead.
15-
default_directory:
16-
deprecation:
17-
removal_version: 2.0.0
18-
warning_text: Use "default" filter with state='directory' instead.

path/plugins/filter/default.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -34,64 +34,10 @@ def _do_default(path, *default_paths, state=None):
3434
return result
3535

3636

37-
def _default_file(paths, *default_paths):
38-
if isinstance(paths, list):
39-
return [_do_default_file(path, *default_paths) for path in paths]
40-
41-
return _do_default_file(paths, *default_paths)
42-
43-
44-
def _do_default_file(path, *default_paths):
45-
if not isinstance(path, dict):
46-
raise AnsibleTemplateError(f"default_file input expects a dict but was given a {type(path).__name__}")
47-
48-
if _test_file(path):
49-
return _default(path, *default_paths)
50-
51-
return path
52-
53-
54-
def _default_link(paths, *default_paths):
55-
if isinstance(paths, list):
56-
return [_do_default_link(path, *default_paths) for path in paths]
57-
58-
return _do_default_link(paths, *default_paths)
59-
60-
61-
def _do_default_link(path, *default_paths):
62-
if not isinstance(path, dict):
63-
raise AnsibleTemplateError(f"default_link input expects a dict but was given a {type(path).__name__}")
64-
65-
if _test_link(path):
66-
return _default(path, *default_paths)
67-
68-
return path
69-
70-
71-
def _default_directory(paths, *default_paths):
72-
if isinstance(paths, list):
73-
return [_do_default_directory(path, *default_paths) for path in paths]
74-
75-
return _do_default_directory(paths, *default_paths)
76-
77-
78-
def _do_default_directory(path, *default_paths):
79-
if not isinstance(path, dict):
80-
raise AnsibleTemplateError(f"default_directory input expects a dict but was given a {type(path).__name__}")
81-
82-
if _test_directory(path):
83-
return _default(path, *default_paths)
84-
85-
return path
86-
87-
8837
class FilterModule(object):
8938
""" Manala path default jinja2 filters """
9039

9140
def filters(self):
9241
return {
9342
'default': _default,
94-
'default_file': _default_file,
95-
'default_link': _default_link,
96-
'default_directory': _default_directory,
9743
}

path/plugins/filter/default_directory.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

path/plugins/filter/default_file.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

path/plugins/filter/default_link.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)