Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Mistyped xtool.yml keys are silently ignored (e.g. entitlements instead of entitlementsPath)

Abierto
#353 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
swift
Área
build-system

Línea de trabajo

The schema is PackSchemaBase in Sources/PackLib/PackSchema.swift (lines 8-36), decoded with Yams around lines 73-75. Start by seeing how the decoder drops unknown keys, then compare the keys in the raw YAML document with the known property set. Done means an unrecognized key such as entitlements or icon produces an error or warning, and the issue's open question about error versus warning is settled with a maintainer.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Keys in xtool.yml that don't match a schema property are silently ignored. Because almost every schema property is optional, a single-character typo in a key name produces a valid-looking build with the wrong contents instead of an error.

PackSchemaBase (Sources/PackLib/PackSchema.swift:8-36) is decoded with plain Codable (via Yams at PackSchema.swift:73-75), so unknown keys are dropped by the decoder and the missing properties decode as nil.

Concrete cases:

  • entitlements: instead of entitlementsPath: — the app is silently built with no entitlements at all. A push/network-extension app then installs but its features fail at runtime, and nothing at configure or build time indicates the file was never used.
  • icon: instead of iconPath: — the app silently ships without its icon. Notably the value is validated (iconPath: icon.jpg fails with "iconPath should have a 'png' path extension", PackSchema.swift:56-60), but a mistyped key isn't.
  • extension: instead of extensions: — the extension is silently not built.
  • bundleId: (lowercase d) instead of bundleID: — then orgID is missing too, and you get "Must specify either orgID or bundleID", which at least fails — but if the project also sets orgID, the explicit bundle-id intent is silently lost.

Related: when both bundleID and orgID are present, bundleID silently wins (PackSchema.swift:41-44); a warning would be reasonable there too.

The version key shows the other behavior is possible: an unsupported version errors out explicitly (PackSchema.swift:43-44), so being strict about unknown keys is consistent with the existing design.

Suggested direction

After decoding, diff the keys actually present in the YAML document against the known property set and throw (or at least warn) on unrecognized keys. YAMLDecoder won't do this on its own, but the raw document keys are easy to obtain with Yams' Yams.load(yaml:), and a short known-key list would catch most typos without much maintenance.

Lenguaje dominante
Swift
Estrellas
5.5k
Forks
163
Merge medio
19 h 16 min
PR fusionados (30 d)
26

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de xtool-org/xtool

Todos los issues de xtool-org/xtool

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.