Skip to content

Commit 67f35ca

Browse files
authored
Merge branch 'main' into create-pull-request/patch
2 parents 16ab63c + afa5f25 commit 67f35ca

File tree

2 files changed

+91
-13
lines changed

2 files changed

+91
-13
lines changed

.github/.grant.yml

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,48 @@
1-
rules:
2-
- pattern: "*"
3-
name: "Block AGPL licenses"
4-
mode: "block"
5-
reason: "AGPL licenses are not allowed in this project"
6-
licenses:
7-
- "agpl"
8-
- "agpl-1.0"
9-
- "agpl-1.0-only"
10-
- "agpl-1.0-or-later"
11-
- "agpl-3.0"
12-
- "agpl-3.0-only"
13-
- "agpl-3.0-or-later"
1+
require-license: false # Some packages may not have explicit licenses
2+
require-known-license: false
3+
4+
# Allow list - licenses that are permitted
5+
allow:
6+
# Permissive licenses
7+
- MIT
8+
- Apache-2.0
9+
- BSD-2-Clause
10+
- BSD-3-Clause
11+
- BSD
12+
- BSD-License
13+
- ISC
14+
- ISC-License
15+
- 0BSD
16+
17+
# Python-specific licenses
18+
- PSF-2.0
19+
- Python-2.0
20+
- Dual-License
21+
22+
# Weak copyleft licenses (generally acceptable)
23+
- LGPL
24+
- LGPL-2.1
25+
- LGPL-2.1-or-later
26+
- LGPL-3.0
27+
- LGPL-3.0-or-later
28+
- MPL-2.0
29+
30+
# Other licenses
31+
- Unlicense
32+
- CC0-1.0
33+
- WTFPL
34+
- Artistic-License
35+
- GPL-3.0-only
36+
37+
# Block list - licenses that are not allowed
38+
block:
39+
- AGPL-1.0
40+
- AGPL-1.0-only
41+
- AGPL-1.0-or-later
42+
- AGPL-3.0
43+
- AGPL-3.0-only
44+
- AGPL-3.0-or-later
45+
46+
# Ignore specific packages if needed
47+
ignore-packages:
48+
- "UnknownPackage:*"

hooks/post_gen_project.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def notify_envrc() -> None:
152152

153153
def notify_dockerhub_secrets() -> None:
154154
"""Notify user about required Docker Hub secrets for releases."""
155+
# We no longer need this once https://github.com/docker/roadmap/issues/314 is available
155156
print("\n" + "=" * 70)
156157
print("IMPORTANT: Docker Hub Publishing Enabled")
157158
print("=" * 70)
@@ -168,6 +169,46 @@ def notify_dockerhub_secrets() -> None:
168169
print("=" * 70 + "\n")
169170

170171

172+
def opportunistically_install_zenable_tools() -> None:
173+
"""Opportunistically install zenable-mcp if uvx is available."""
174+
# Check if uvx is not available
175+
if not shutil.which("uvx"):
176+
# uvx is not available, notify the user
177+
print("\n" + "=" * 70)
178+
print("NOTE: Skipped configuring the Zenable AI coding guardrails")
179+
print("=" * 70)
180+
print("\nConfiguring the Zenable AI coding guardrails requires the uv package manager.")
181+
print("To set this up later:")
182+
print("\n1. Install uv via https://docs.astral.sh/uv/getting-started/installation/")
183+
print("2. Run: uvx zenable-mcp@latest install")
184+
print("=" * 70 + "\n")
185+
186+
LOG.warning("uvx was not found in PATH, so the Zenable integrations were not installed.")
187+
return
188+
189+
# uvx is available, attempt to install zenable-mcp
190+
LOG.debug("uvx is available in PATH, attempting to install the Zenable tools...")
191+
try:
192+
subprocess.run(["uvx", "zenable-mcp@latest", "install"], check=True, timeout=60)
193+
print("\n" + "=" * 70)
194+
print("Successfully configured the Zenable AI coding guardrails 🚀")
195+
print("To start using it, just open the IDE of your choice, login to the MCP server, and you're all set 🤖")
196+
print("Learn more at https://docs.zenable.io")
197+
print("=" * 70 + "\n")
198+
except Exception:
199+
# Log the error but don't fail - this is opportunistic
200+
LOG.warning("Failed to configure the Zenable AI coding guardrails")
201+
print("\n" + "=" * 70)
202+
print("WARNING: Failed to configure the Zenable AI coding guardrails")
203+
print("=" * 70)
204+
print("You can retry it later by running:")
205+
print("\n uvx zenable-mcp@latest install")
206+
print("\nTo report issues, please contact:")
207+
print(" • https://zenable.io/feedback")
208+
print(" • support@zenable.io")
209+
print("=" * 70 + "\n")
210+
211+
171212
def run_post_gen_hook():
172213
"""Run post generation hook"""
173214
try:
@@ -185,6 +226,8 @@ def run_post_gen_hook():
185226

186227
subprocess.run(["git", "init", "--initial-branch=main"], capture_output=True, check=True)
187228

229+
opportunistically_install_zenable_tools()
230+
188231
# This is important for testing project generation for CI
189232
if (
190233
os.environ.get("GITHUB_ACTIONS") == "true"

0 commit comments

Comments
 (0)