Skip to content

feat(HDNEXT-1608): migrate app-list config to ncw-config's .list format - #148

Open
Arsalanulhaq wants to merge 7 commits into
masterfrom
as/dev/HDNEXT-1608-ncw-config-migration
Open

feat(HDNEXT-1608): migrate app-list config to ncw-config's .list format#148
Arsalanulhaq wants to merge 7 commits into
masterfrom
as/dev/HDNEXT-1608-ncw-config-migration

Conversation

@Arsalanulhaq

Copy link
Copy Markdown

Replace disabled-apps.inc.sh / enabled-core-apps.inc.sh shell arrays with plain line-based disabled-apps.list / enabled-core-apps.list, matching the ncw-config approach. configure.sh, apps-enable.sh and apps-disable.sh now read these via a read_app_list() helper instead of sourcing shell files.

Also add always-enabled-apps.list support in apps-disable.sh (ports the alwaysEnabled enforcement in shipped.json from ncw-config), plus .list-format-spec.md and .gitattributes documenting/handling the new format.

always-enabled-apps.list is left empty for now - deciding which HiDrive Next apps should become non-disableable is a separate product decision.

@Arsalanulhaq
Arsalanulhaq force-pushed the as/dev/HDNEXT-1608-ncw-config-migration branch from f081dd2 to e0446c9 Compare August 10, 2026 12:26
@Arsalanulhaq Arsalanulhaq changed the title HDNEXT-1608: migrate app-list config to ncw-config's .list format feat(HDNEXT-1608): migrate app-list config to ncw-config's .list format Aug 10, 2026
@Arsalanulhaq
Arsalanulhaq force-pushed the as/dev/HDNEXT-1608-ncw-config-migration branch from 0c7ed4a to 2cd9660 Compare August 10, 2026 14:42
@printminion-co
printminion-co requested a lite review from Copilot August 12, 2026 10:26

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

Migrates app enable/disable configuration from sourced shell include files to a line-based .list format (aligned with ncw-config), and updates the supporting scripts to read these lists via a helper function. It also extends apps-disable.sh to support an optional “always enabled” list and documents the new list format.

Changes:

  • Replace enabled-core-apps.inc.sh / disabled-apps.inc.sh usage with .list files and read_app_list() in relevant scripts.
  • Add always-enabled-apps.list support and enhance apps-disable.sh’s shipped.json patching behavior.
  • Document and enforce .list handling via .list-format-spec.md and .gitattributes.

Reviewed changes

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

Show a summary per file
File Description
enabled-core-apps.list Converted core-enabled app configuration to line-based list format.
disabled-apps.list Converted disabled app configuration to line-based list format.
configure.sh Loads disabled apps via .list + adds env validation and secret-safe OCC helper.
configure-user-oidc.sh Adds env validation helper and improves error handling for required vars.
configure-object-store.sh Adds env validation helper to reduce repeated checks.
apps-enable.sh Reads enabled/disabled app lists from .list files via helper.
apps-disable.sh Reads disabled/always-enabled lists and patches core/shipped.json accordingly.
always-enabled-apps.list Introduces (currently empty) list for non-disableable apps.
.list-format-spec.md Adds documentation for the .list format and how scripts process it.
.gitattributes Ensures consistent LF handling and linguist language for .list files.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps-disable.sh
Comment on lines 102 to 105
main() {
if ! which jq 2>&1 >/dev/null; then
log_fatal "jq is required"
fi
Comment thread always-enabled-apps.list
Comment on lines +12 to +16
# Format:
# - One app name per line
# - Lines starting with # are comments
# - Empty lines are ignored
# - Whitespace is trimmed
Comment thread .list-format-spec.md
Comment on lines +53 to +63
Scripts process these files using standard shell commands:
```bash
# Example: Read and filter
grep -v '^#' file.list | grep -v '^[[:space:]]*$'
```

This approach:
1. Removes comment lines (`^#`)
2. Removes empty lines (`^[[:space:]]*$`)
3. Preserves item names exactly as written

Replace disabled-apps.inc.sh / enabled-core-apps.inc.sh shell arrays with
plain line-based disabled-apps.list / enabled-core-apps.list, matching the
ncw-config approach. configure.sh, apps-enable.sh and apps-disable.sh now
read these via a read_app_list() helper instead of sourcing shell files.

Also add always-enabled-apps.list support in apps-disable.sh (ports the
alwaysEnabled enforcement in shipped.json from ncw-config), plus
.list-format-spec.md and .gitattributes documenting/handling the new format.

always-enabled-apps.list is left empty for now - deciding which HiDrive
Next apps should become non-disableable is a separate product decision.
disable_configured_apps() uses jq via 'occ app:list --output json | jq',
but check_dependencies() only checked for php. Port ncw-config's jq check
so a missing jq fails fast with a clear error instead of a confusing
mid-script failure.
…bearing OCC calls

Port ncw-config's execute_occ_secret_command, which omits command arguments
from error logs, plus a safety net in execute_occ_command that delegates to
it when --secret/--sensitive is detected in the arguments.

Switch the two secret-bearing calls (nc_ionos_processes basic_auth_pass,
serverinfo token) to use it, so a failed OCC call never logs the raw
credential/token value.
… checks

Port ncw-config's validate_env_vars, which warns per-missing-variable and
returns non-zero if any are unset. Replace the ad-hoc -z/OR chains in
configure_ionos_processes_app (3 vars) and configure_app_richdocuments
(2 vars) with it - same behavior, less repetition, and callers now get a
warning naming exactly which variable is missing instead of a generic
"X, Y or Z not set" message.
Replace the 6 sequential -z/log_fatal checks for ENC_OBJECT_STORAGE_* vars
with a single validate_env_vars call (ported from ncw-config, same helper
added to configure.sh). Now reports every missing variable at once instead
of stopping at the first one.
Three code paths (missing logout URIs for a non-DEV instance, missing
INSTANCE_TYPE, missing MARKET) called fail(), which is never defined in
this script - it would have errored with "fail: command not found" instead
of the intended fatal error message. Use the already-defined log_fatal
instead.
Replace the 9 sequential -z/log_fatal checks (7 ENC_OIDC_* vars plus
INSTANCE_TYPE and MARKET) with a single validate_env_vars call, matching
the same helper already added to configure.sh and
configure-object-store.sh. Reports every missing variable at once instead
of stopping at the first one.
@printminion-co
printminion-co force-pushed the as/dev/HDNEXT-1608-ncw-config-migration branch from 2cd9660 to f474454 Compare August 14, 2026 07:00
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.

2 participants