Skip to content

TypeError in CustomProperties normalize() after upgrading to 2.1.19 #971

@breymander

Description

@breymander

Problem Description

After upgrading from 2.1.18 to 2.1.19, the safe-settings dry-run validator fails on every repository that has custom_properties defined in a suborg config. The error is:

TypeError: Cannot read properties of undefined (reading 'toLowerCase') in CustomProperties

This affects all repositories matched by the suborg — in our case, 115 repos.

What is actually happening

The normalize() method introduced in PR #738 destructures property_name from the paginated API response, but the value is undefined for some entries, causing .toLowerCase() to throw:

normalize (properties) {
    return properties.map(({ property_name: propertyName, value }) => ({
      name: propertyName.toLowerCase(),  // <-- TypeError when propertyName is undefined
      value
    }))
}

The likely cause is that this.github.paginate() returns data in a different shape than this.github.repos.getCustomPropertiesValues returns directly — the old code in 2.1.18 used this.github.request('GET /repos/:org/:repo/properties/values') and accessed data.data, which worked correctly.

Validator output (truncated)

my-service-helm3:
  * error TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    in CustomProperties for repo: {"owner":"my-org","repo":"my-service-helm3"}
    entries [{"name":"owner","value":"My Team"},{"name":"criticality","value":"High"},
    {"name":"exposure","value":"Internal"},{"name":"lifecycle","value":"Production"},
    {"name":"pci","value":"false"}]

This error repeats for every repo matched by the suborg pattern.

Suborg config (simplified)

custom_properties:
  - name: Owner
    value: My Team
  - name: Criticality
    value: High
  - name: Exposure
    value: Internal
  - name: Lifecycle
    value: Production
  - name: PCI
    value: "false"

All of these properties exist at the org level and have not been modified.

What is the expected behavior

Custom properties should be fetched, normalized, and compared without errors — as they were in 2.1.18.

Reproduction

  1. Define custom_properties in a suborg config (e.g., suborgs/my-suborg.yml)
  2. Open a PR that triggers the validator against those repos
  3. The "Safe-setting validator" check run fails with the toLowerCase TypeError

Bisected

We confirmed the regression by observing the same PR produce different results on the same commit at different times:

Date Chart version Validator result
Apr 2, 2026 2.1.18 Success
Apr 7, 2026 2.1.19 Failure

The only change between the two runs was upgrading the helm chart from 2.1.18 to 2.1.19.

Root cause

PR #738 refactored custom_properties.js to use this.github.paginate(this.github.repos.getCustomPropertiesValues, ...) instead of this.github.request(...). The normalize() method assumes the paginated response contains objects with a property_name field, but the actual response shape from paginate() appears to differ, resulting in undefined.

Context

  • Chart version: 2.1.19 (helm chart from ghcr.io/github/helm-charts)
  • Previous working version: 2.1.18
  • Platform: github.com
  • Self-hosted via helm chart on GKE, deployed through ArgoCD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions