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

Expose the current phase in context #1883

Closed
noirbizarre opened this issue Dec 8, 2024 · 1 comment
Closed

Expose the current phase in context #1883

noirbizarre opened this issue Dec 8, 2024 · 1 comment

Comments

@noirbizarre
Copy link
Contributor

noirbizarre commented Dec 8, 2024

Actual Situation

Extensions have no way of knowing the current phase (aka. questions, render, tasks or migration).

As a consequence, they have to guess which context variable is available and safe for them to use.

Ex: copier-templates-extensions was guessing the rendering phase with the presence of _copier_conf context var but is broken since 9.4 due to its heuristic not working anymore

Desired Situation

Jinja extension can selectively run during the phase they intend to, and they have a safe way of knowing which phase is currently being executed

Proposed solution

In addition to an _operation context variable which has already been proposed and pending merge (#1733), a _phase context variable is also added.
Its value can be one of questions (or prompt), render, migrate or tasks.

noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 26, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 26, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 28, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 29, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Jan 29, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Feb 21, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Feb 21, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Feb 21, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Feb 22, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Feb 22, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Feb 28, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Mar 1, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Mar 1, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Mar 1, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Mar 1, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Mar 1, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
noirbizarre added a commit to noirbizarre/copier that referenced this issue Mar 2, 2025

Verified

This commit was signed with the committer’s verified signature.
noirbizarre Axel H.
@sisp
Copy link
Member

sisp commented Mar 2, 2025

Resolved via #1948.

@sisp sisp closed this as completed Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants