Skip to content

feat(config): market-specific URLs via config partial (alt to #118)#121

Merged
bromiesTM merged 6 commits into
ionos-dev-v30from
mk/dev/market-urls-config-partial
Jun 5, 2026
Merged

feat(config): market-specific URLs via config partial (alt to #118)#121
bromiesTM merged 6 commits into
ionos-dev-v30from
mk/dev/market-urls-config-partial

Conversation

@printminion-co

Copy link
Copy Markdown
Contributor

Alternative to #118 — market URLs via config partial

PR #118 sets market-specific IONOS URLs imperatively in configure.sh through a
set_market_links() bash case that calls ooc config:system:set .... This branch
proposes a declarative alternative and aligns with the no-config:system:set policy
already adopted on master.

What changes

  • configs/ionos-links.config.php is now market-aware: it resolves the MARKET
    pod env var and returns the matching links (FR/DE/ES/UK/IT, DE fallback for
    unset/invalid). Single declarative source of truth, evaluated per request — no
    imperative occ writes, no persisted-state drift. The logic is wrapped in an IIFE so
    only $CONFIG enters Nextcloud's config-loader scope, and ionos_webmail_target_link
    stays nested under ionos_peer_products (as the theme reads it).
  • Adopt the shell-config check (cherry-picked from master: a7a6bd0, cf4ae3a) —
    CI fails on any config:system:set in shell scripts.
  • Drop the last config:system:set: lookup_server moves to a new
    configs/nc-server.config.php (replicating master 3c1cd2e), so the check passes.
  • log_market_config() in configure.sh logs MARKET and the effective links
    (read-only config:system:get) for pod-log troubleshooting.
  • New config-validation workflow (.github/check-config-urls.php): loads the
    partial for every market with PHP notices promoted to failures, and asserts each
    required link key is a well-formed https URL — catching broken PHP, dropped
    schemes, and missing/renamed keys.

Verification

  • ./.github/check-shell-config.sh → passes (no config:system:set in shell).
  • php -l on all configs/*.config.php.
  • Per-market resolution verified (webmail nesting + client links); unset/invalid → DE.
  • php .github/check-config-urls.php passes, and was confirmed to fail on a broken URL
    and a missing key.

Closes the approach discussion on #118 (does not auto-close the PR).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR proposes a declarative, market-aware approach for IONOS URLs by resolving links at runtime from a config partial (based on MARKET), avoiding imperative occ config:system:set writes and adding CI checks to enforce that policy.

Changes:

  • Make configs/ionos-links.config.php resolve market-specific URLs from MARKET with a DE fallback.
  • Remove the last config:system:set from configure.sh by moving lookup_server into a config partial.
  • Add CI workflows/scripts to (a) forbid config:system:set usage in shell scripts and (b) validate config partial URL structure across markets.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
configure.sh Removes imperative lookup_server write and logs effective market link config via read-only config:system:get.
configs/nc-server.config.php Introduces declarative lookup_server config to replace shell-based mutation.
configs/ionos-links.config.php Implements market-aware link selection via MARKET with a fallback.
.github/workflows/shell-config-check.yml Adds CI job to run a shell-script policy check (currently has invalid YAML indentation).
.github/workflows/config-validation.yml Adds CI job to lint config partials and validate URLs (currently has invalid YAML indentation).
.github/check-shell-config.sh Implements repository scan for config:system:set in *.sh files.
.github/check-config-urls.php Validates required IONOS URL keys and https schemes across markets with warnings/notices promoted to failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/config-validation.yml Outdated
Comment thread .github/workflows/shell-config-check.yml Outdated
Comment thread configs/ionos-links.config.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread .github/check-shell-config.sh
Comment thread configs/nc-server.config.php Outdated
@printminion-co printminion-co force-pushed the mk/dev/market-urls-config-partial branch 3 times, most recently from 33ebf9a to 35512c8 Compare June 5, 2026 07:40
Moves the empty lookup_server setting out of the configure.sh runtime
script and into configs/nc-server.config.php so it is applied
declaratively at config-load time. This eliminates the only
config:system:set usage in shell scripts and unblocks adoption of the
shell-config-check workflow.

The partial config file is picked up automatically by the
add_config_partials Makefile target which copies all
IONOS/configs/*.config.php into Nextcloud's config/ directory.

Backport of 3c1cd2e from master (adapted: this branch still uses the
ooc() helper rather than execute_occ_command).

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
… usage in shell scripts

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Resolve IONOS links from the MARKET env var declaratively in
ionos-links.config.php (IIFE-scoped, ionos_peer_products nesting, DE
fallback) instead of imperatively via config:system:set in configure.sh.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Add a read-only log_market_config() that echoes MARKET and the effective
IONOS links via config:system:get, so the resolved values appear in the
pod log for troubleshooting. Called from main() after config_ui.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Add check-config-urls.php (loads ionos-links.config.php for every MARKET with
PHP notices promoted to failures; asserts required link keys are well-formed
https URLs) and a config-validation workflow running php -l plus the check.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
When running in GitHub Actions (GITHUB_ACTIONS=true), check-config-urls.php now
emits workflow commands: collapsible per-market ::group:: sections, inline
::error annotations pointing at the offending line in the partial (and a final
::notice on success), plus a job-summary table via GITHUB_STEP_SUMMARY. Outside
CI the output stays plain text and exit codes are unchanged.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread configs/ionos-links.config.php
@bromiesTM bromiesTM merged commit f657563 into ionos-dev-v30 Jun 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants