Skip to content

Comments

Update gen_patch_metadata for DB patches#400

Open
mfielding wants to merge 2 commits intomasterfrom
patch-metadata
Open

Update gen_patch_metadata for DB patches#400
mfielding wants to merge 2 commits intomasterfrom
patch-metadata

Conversation

@mfielding
Copy link
Member

gen_patch_metadata.py is a helper script for Oracle quarterly patches, but has not kept up with toolkit updates, as well as data inconsistencies upstream. This change retains the basic structure, but fixes several issues:

  • Support for database combo patches, in addition to the existing GI combo patches
  • Using the now-standard lowercase for TRUE and FALSE
  • Handling an issue in current 21c patches where the HTML title tag is empty, but the text is still in the meta tag
  • Handling the new minimum_opatch field by extracting version.txt from the current OPatch zip file
  • Some formatting updates that Gemini liked - 4-character spaces make the diffs tough to read sadly
  • Handling 21c patch variances, notably the lack of sub-patches
  • Updating type hints for Requests

A diff ignoring the whitespace changes:

https://gist.github.com/mfielding/39713d4318f677bc45981080e8f7caa2

Sample output from latest patches:

$ python3 new_gen_patch_metadata.py --patch=38658588  --mosuser mfielding@google.com
MOS Password:
INFO:root:Abstract: COMBO OF OJVM COMPONENT 19.30.0.0.260120 + GI RU 19.30.0.0.260120
INFO:root:Downloading OPatch metadata...
Add to roles/common/defaults/main/gi_patches.yml:
  - { category: "RU", base: "19.3.0.0.0", release: "19.30.0.0.260120", patchnum: "38658588", patchfile: "p38658588_190000_Linux-x86-64.zip", patch_subdir: "/38629535", prereq_check: false, method: "opatchauto apply", ocm: false, upgrade: false, md5sum: "OiwVAK9ag4pbCxXqvkxUpw==", minimum_opatch: "12.2.0.1.49" }

Add to roles/common/defaults/main/rdbms_patches.yml:
  - { category: "RU_Combo", base: "19.3.0.0.0", release: "19.30.0.0.260120", patchnum: "38658588", patchfile: "p38658588_190000_Linux-x86-64.zip", patch_subdir: "/38523609", prereq_check: true, method: "opatch apply", ocm: false, upgrade: true, md5sum: "OiwVAK9ag4pbCxXqvkxUpw==", minimum_opatch: "12.2.0.1.49" }
$ python3 new_gen_patch_metadata.py --patch=38658587  --mosuser mfielding@google.com
MOS Password:
INFO:root:Abstract: COMBO OF OJVM COMPONENT 19.30.0.0.260120 + DB RU 19.30.0.0.260120
INFO:root:Downloading OPatch metadata...
Add to roles/common/defaults/main/rdbms_patches.yml:
  - { category: "DB_OJVM_RU", base: "19.3.0.0.0", release: "19.30.0.0.260120", patchnum: "38658587", patchfile: "p38658587_190000_Linux-x86-64.zip", patch_subdir: "/38523609", prereq_check: true, method: "opatch apply", ocm: false, upgrade: true, md5sum: "De2izV3i+NgGZ8M1nHUEZQ==", minimum_opatch: "12.2.0.1.49" }
  - { category: "DB_RU", base: "19.3.0.0.0", release: "19.30.0.0.260120", patchnum: "38658587", patchfile: "p38658587_190000_Linux-x86-64.zip", patch_subdir: "/38632161", prereq_check: true, method: "opatch apply", ocm: false, upgrade: true, md5sum: "De2izV3i+NgGZ8M1nHUEZQ==", minimum_opatch: "12.2.0.1.49" }

$ python3 new_gen_patch_metadata.py --patch=38725048 --mosuser mfielding@google.com --debug
MOS Password:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): updates.oracle.com:443
DEBUG:urllib3.connectionpool:https://updates.oracle.com:443 "GET /Orion/SimpleSearch/process_form?search_type=patch&patch_number=38725048&plat_lang=226P HTTP/1.1" 200 3870
INFO:root:Abstract: DATABASE RELEASE UPDATE 21.21.0.0.0
DEBUG:root:21c patch with no subdirs found; defaulting to root "/"
DEBUG:root:Final selection - GI: None, DB: , OJVM: None. is_gi: False
INFO:root:Downloading OPatch metadata...
DEBUG:urllib3.connectionpool:https://updates.oracle.com:443 "GET /Orion/SimpleSearch/process_form?search_type=patch&patch_number=6880880&plat_lang=226P HTTP/1.1" 200 None
Add to roles/common/defaults/main/rdbms_patches.yml:
  - { category: "DB_RU", base: "21.0.0.0.0", release: "21.21.0.0.0", patchnum: "38725048", patchfile: "p38725048_210000_Linux-x86-64.zip", patch_subdir: "/", prereq_check: true, method: "opatch apply", ocm: false, upgrade: true, md5sum: "GwM+wklzKV+cZpJ5g22WkA==", minimum_opatch: "12.2.0.1.49" }

gen_patch_metadata.py is a helper script for Oracle quarterly patches,
but has not kept up with toolkit updates, as well as data
inconsistencies upstream.  This change retains the basic structure, but
fixes several issues:

* Support for database combo patches, in addition to the existing GI
  combo patches
* Using the now-standard lowercase for TRUE and FALSE
* Handling an issue in current 21c patches where the HTML title tag is
  empty, but the text is still in the meta tag
* Handling the new `minimum_opatch` field by extracting `version.txt`
  from the current OPatch zip file
* Some formatting updates that Gemini liked
* Handling 21c patch variances, notably the lack of sub-patches
* Updating type hints for Requests

Sample output from latest patches:

```
$ python3 new_gen_patch_metadata.py --patch=38658588  --mosuser mfielding@google.com
MOS Password:
INFO:root:Abstract: COMBO OF OJVM COMPONENT 19.30.0.0.260120 + GI RU 19.30.0.0.260120
INFO:root:Downloading OPatch metadata...
Add to roles/common/defaults/main/gi_patches.yml:
  - { category: "RU", base: "19.3.0.0.0", release: "19.30.0.0.260120", patchnum: "38658588", patchfile: "p38658588_190000_Linux-x86-64.zip", patch_subdir: "/38629535", prereq_check: false, method: "opatchauto apply", ocm: false, upgrade: false, md5sum: "OiwVAK9ag4pbCxXqvkxUpw==", minimum_opatch: "12.2.0.1.49" }

Add to roles/common/defaults/main/rdbms_patches.yml:
  - { category: "RU_Combo", base: "19.3.0.0.0", release: "19.30.0.0.260120", patchnum: "38658588", patchfile: "p38658588_190000_Linux-x86-64.zip", patch_subdir: "/38523609", prereq_check: true, method: "opatch apply", ocm: false, upgrade: true, md5sum: "OiwVAK9ag4pbCxXqvkxUpw==", minimum_opatch: "12.2.0.1.49" }
$ python3 new_gen_patch_metadata.py --patch=38658587  --mosuser mfielding@google.com
MOS Password:
INFO:root:Abstract: COMBO OF OJVM COMPONENT 19.30.0.0.260120 + DB RU 19.30.0.0.260120
INFO:root:Downloading OPatch metadata...
Add to roles/common/defaults/main/rdbms_patches.yml:
  - { category: "DB_OJVM_RU", base: "19.3.0.0.0", release: "19.30.0.0.260120", patchnum: "38658587", patchfile: "p38658587_190000_Linux-x86-64.zip", patch_subdir: "/38523609", prereq_check: true, method: "opatch apply", ocm: false, upgrade: true, md5sum: "De2izV3i+NgGZ8M1nHUEZQ==", minimum_opatch: "12.2.0.1.49" }
  - { category: "DB_RU", base: "19.3.0.0.0", release: "19.30.0.0.260120", patchnum: "38658587", patchfile: "p38658587_190000_Linux-x86-64.zip", patch_subdir: "/38632161", prereq_check: true, method: "opatch apply", ocm: false, upgrade: true, md5sum: "De2izV3i+NgGZ8M1nHUEZQ==", minimum_opatch: "12.2.0.1.49" }

$ python3 new_gen_patch_metadata.py --patch=38725048 --mosuser mfielding@google.com --debug
MOS Password:
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): updates.oracle.com:443
DEBUG:urllib3.connectionpool:https://updates.oracle.com:443 "GET /Orion/SimpleSearch/process_form?search_type=patch&patch_number=38725048&plat_lang=226P HTTP/1.1" 200 3870
INFO:root:Abstract: DATABASE RELEASE UPDATE 21.21.0.0.0
DEBUG:root:21c patch with no subdirs found; defaulting to root "/"
DEBUG:root:Final selection - GI: None, DB: , OJVM: None. is_gi: False
INFO:root:Downloading OPatch metadata...
DEBUG:urllib3.connectionpool:https://updates.oracle.com:443 "GET /Orion/SimpleSearch/process_form?search_type=patch&patch_number=6880880&plat_lang=226P HTTP/1.1" 200 None
Add to roles/common/defaults/main/rdbms_patches.yml:
  - { category: "DB_RU", base: "21.0.0.0.0", release: "21.21.0.0.0", patchnum: "38725048", patchfile: "p38725048_210000_Linux-x86-64.zip", patch_subdir: "/", prereq_check: true, method: "opatch apply", ocm: false, upgrade: true, md5sum: "GwM+wklzKV+cZpJ5g22WkA==", minimum_opatch: "12.2.0.1.49" }
```
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mfielding

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

To avoid incorrect hostname matching, and to make the security scanner
happy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant