Skip to content

Add backend/config developer guide, DELTA.md automation, and gen_delt…#8

Closed
gkostin1966 wants to merge 2 commits into
mainfrom
DEEPBLUE-466/backend
Closed

Add backend/config developer guide, DELTA.md automation, and gen_delt…#8
gkostin1966 wants to merge 2 commits into
mainfrom
DEEPBLUE-466/backend

Conversation

@gkostin1966
Copy link
Copy Markdown
Collaborator

…a.py

  • backend/config/README.md: developer guide for updating dspace.cfg secrets in Kubernetes across production, workshop, and demo environments. Covers the two-layer config (Secret + ConfigMap overrides), kubectl context switching, step-by-step secret update workflow, and how to regenerate the local cfg files from scratch.

  • backend/config/DELTA.md: auto-generated comparison of the three dspace.cfg environments (25 differing properties, key findings, recommendations). Regenerated by dotpy/gen_delta.py.

  • dotpy/gen_delta.py: new script that parses the three from-kube.*.dspace.cfg files, computes all differing properties, redacts sensitive values, and writes a fresh DELTA.md with a padded Markdown table, auto-detected findings, and recommendations.

  • dotpy/README.md: added gen_delta.py entry following existing conventions.

  • .gitignore: added backend/config/*.cfg to prevent secrets from being committed (db passwords, DOI credentials, API keys).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds developer-facing documentation and a repeatable automation path for comparing and updating Kubernetes-managed dspace.cfg across demo/production/workshop, while keeping decrypted cfg files out of version control.

Changes:

  • Added backend/config/README.md with a step-by-step workflow for fetching, editing, and reapplying the dspace-cfg Secret (and explaining ConfigMap overrides).
  • Added dotpy/gen_delta.py to regenerate an auto-redacted backend/config/DELTA.md comparing environment configs.
  • Updated .gitignore to exclude backend/config/*.cfg and added dotpy/README.md documentation for the new script.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
dotpy/gen_delta.py New generator script to diff three cfg files and produce a redacted DELTA.md with findings/recommendations.
dotpy/README.md Documents how to run gen_delta.py and fetch prerequisite cfg files.
backend/config/README.md New operational guide for managing dspace.cfg Secrets and ConfigMap overrides across environments.
backend/config/DELTA.md Generated comparison artifact summarizing current config differences and findings.
.gitignore Prevents committing decrypted cfg files containing secrets.

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

Comment thread backend/config/README.md Outdated
Comment on lines +193 to +203
```shell
cat from-kube.<NAMESPACE>.dspace.cfg | base64 > from-kube.<NAMESPACE>.dspace.cfg.base64
```

### 4. Patch the secret directly (recommended)

```shell
kubectl -n <NAMESPACE> patch secret dspace-cfg \
--type='json' \
-p="[{\"op\":\"replace\",\"path\":\"/data/dspace.cfg\",\"value\":\"$(cat from-kube.<NAMESPACE>.dspace.cfg.base64)\"}]"
```
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The base64 re-encode + JSON patch workflow is likely to fail because base64 commonly inserts newlines/wrapping, and $(cat …) will embed those literal newlines into the JSON string passed to kubectl patch. Use a no-wrap base64 option (e.g., base64 -w 0 / base64 --wrap=0) or strip newlines (tr -d '\n') so the patched value is a single-line base64 string.

Copilot uses AI. Check for mistakes.
Comment thread backend/config/README.md Outdated
Comment thread dotpy/gen_delta.py Outdated
Comment thread dotpy/gen_delta.py Outdated
Comment thread backend/config/README.md
Comment on lines +167 to +170
```shell
kubectl -n <NAMESPACE> get secret dspace-cfg \
-o jsonpath="{.data.dspace\.cfg}" | base64 --decode > from-kube.<NAMESPACE>.dspace.cfg
```
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Step 1 writes the decrypted Secret to from-kube.<NAMESPACE>.dspace.cfg in the current working directory, but only backend/config/*.cfg is gitignored. If someone runs this from the repo root (likely), they will create a plaintext secrets file that is not ignored and could be committed accidentally. Update the commands to write into backend/config/ (or explicitly instruct users to cd backend/config before starting).

Copilot uses AI. Check for mistakes.
…a.py

- backend/config/README.md: developer guide for updating dspace.cfg secrets
  in Kubernetes across production, workshop, and demo environments.
  Covers the two-layer config (Secret + ConfigMap overrides), kubectl
  context switching, step-by-step secret update workflow, and how to
  regenerate the local cfg files from scratch.

- backend/config/DELTA.md: auto-generated comparison of the three
  dspace.cfg environments (25 differing properties, key findings,
  recommendations). Regenerated by dotpy/gen_delta.py.

- dotpy/gen_delta.py: new script that parses the three from-kube.*.dspace.cfg
  files, computes all differing properties, redacts sensitive values, and
  writes a fresh DELTA.md with a padded Markdown table, auto-detected
  findings, and recommendations.

- dotpy/README.md: added gen_delta.py entry following existing conventions.

- .gitignore: added backend/config/*.cfg to prevent secrets from being
  committed (db passwords, DOI credentials, API keys).
@gkostin1966 gkostin1966 force-pushed the DEEPBLUE-466/backend branch from e8f57ba to a6a9314 Compare April 22, 2026 11:55
@gkostin1966
Copy link
Copy Markdown
Collaborator Author

Moved this code to deepblue-documents-kube project. Closing this PR and deleting the branch.

@gkostin1966 gkostin1966 deleted the DEEPBLUE-466/backend branch April 22, 2026 12:17
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