Date: August 30, 2025 Context: Moving from system-level hardcoded Notion values to user-level configuration Target: Complete migration to PIPER.user.md configuration structure
This migration guide provides step-by-step instructions for moving from hardcoded Notion workspace values to a flexible, user-specific configuration system. The new system supports multi-user adoption and eliminates the need for code changes when workspace details change.
# Copy the example configuration
cp config/PIPER.user.md.example config/PIPER.user.md
# Edit the file to add your Notion configuration
nano config/PIPER.user.md
Based on the audit findings, here are the specific hardcoded values and their new configuration paths:
| Source File | Line | Hardcoded Value | Configuration Path | Risk Level |
|---|---|---|---|---|
fields.py |
12 | 25e11704d8bf80deaac2f806390fe7da |
notion.adrs.database_id |
HIGH |
adr.py |
12 | 25e11704d8bf80deaac2f806390fe7da |
notion.adrs.database_id |
HIGH |
test_publish_command.py |
18 | 25d11704d8bf81dfb37acbdc143e6a80 |
notion.development.test_parent |
MEDIUM |
test_publish_gaps.py |
21 | 25d11704d8bf8135a3c9c732704c88a4 |
notion.development.test_parent |
MEDIUM |
tests/debug_parent.py |
19 | 25d11704d8bf80c8a71ddbe7aba51f55 |
notion.publishing.default_parent |
MEDIUM |
Add the following configuration to your config/PIPER.user.md:
notion:
# REQUIRED: Core Publishing (based on audit findings)
publishing:
default_parent: "25d11704d8bf80c8a71ddbe7aba51f55" # From debug_parent.py:19
enabled: true
# REQUIRED: ADR Database (HIGH risk from audit)
adrs:
database_id: "25e11704d8bf80deaac2f806390fe7da" # From fields.py:12, adr.py:12
enabled: true
auto_publish: true
# OPTIONAL: Workspace Configuration
workspace:
id: null # API discovery fallback
name: "" # Human-readable reference
# OPTIONAL: Development & Testing
development:
test_parent: "25d11704d8bf81dfb37acbdc143e6a80" # From test_publish_command.py:18
debug_parent: "25d11704d8bf80c8a71ddbe7aba51f55" # From debug_parent.py:19
mock_mode: false
# OPTIONAL: Validation Settings (tiered approach)
validation:
level: "basic" # basic|enhanced|full
connectivity_check: true
cache_results: true
After creating your configuration, validate it using the new CLI commands:
# Test basic configuration format
piper notion test-config
# Validate configuration with different levels
piper notion validate --level basic # Format + basic connectivity
piper notion validate --level enhanced # Resource accessibility
piper notion validate --level full # Comprehensive permissions
Verify your configuration works correctly:
# Test ADR publishing with new configuration
piper publish docs/architecture/adr/adr-026-notion-client-migration.md --to notion --database
# Test page publishing with new configuration
piper publish README.md --to notion --location
# List your Notion pages to verify connectivity
piper notion pages
# Search for content to verify access
piper notion search --query "test"
notion.adrs.database_id25e11704d8bf80deaac2f806390fe7danotion.publishing.default_parent25d11704d8bf80c8a71ddbe7aba51f55notion.workspace.idnotion.workspace.namenotion.development.test_parentnotion.development.debug_parentnotion.development.mock_modenotion.validation.level| Format: “basic” | “enhanced” | “full” |
notion.validation.connectivity_checknotion.validation.cache_resultsError: Configuration file not found
Resolution: Ensure config/PIPER.user.md exists and is readable
Error: Invalid database_id format: must be 32 hexadecimal characters
Resolution: Check that your Notion ID is exactly 32 characters long and contains only 0-9 and a-f
Error: Database not accessible: permission denied
Resolution:
1. Verify your NOTION_API_KEY has access to the specified database
2. Check that the database ID is correct
3. Ensure your integration has been added to the database
Error: Failed to connect to Notion API
Resolution:
1. Check your internet connection
2. Verify NOTION_API_KEY is set correctly
3. Check if Notion API is experiencing issues
If you encounter issues during migration:
piper notion validate --level basicpiper notion statusAfter successful migration:
The new configuration system supports future enhancements:
This migration transforms the Notion integration from a rigid, single-workspace system to a flexible, multi-user configuration system. The benefits include:
Follow the step-by-step process above to complete your migration. If you encounter any issues, refer to the troubleshooting section or create a GitHub issue for assistance.