{"record":{"id":"b80b389b2cf1348e","repo":"cross-rs/cross","slug":"invalid-header-section-got-s","errorCode":null,"errorMessage":"invalid header section, got {s}","messagePattern":"invalid header section, got (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/changelog.rs","lineNumber":127,"sourceCode":"#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq)]\n#[serde(rename_all = \"lowercase\")]\nenum ChangelogType {\n    Added,\n    Changed,\n    Fixed,\n    Removed,\n    Internal,\n}\n\nimpl ChangelogType {\n    fn from_header(s: &str) -> cross::Result<Self> {\n        Ok(match s {\n            \"Added\" => Self::Added,\n            \"Changed\" => Self::Changed,\n            \"Fixed\" => Self::Fixed,\n            \"Removed\" => Self::Removed,\n            \"Internal\" => Self::Internal,\n            _ => eyre::bail!(\"invalid header section, got {s}\"),\n        })\n    }\n\n    fn sort_by(&self) -> u32 {\n        match self {\n            ChangelogType::Added => 4,\n            ChangelogType::Changed => 3,\n            ChangelogType::Fixed => 2,\n            ChangelogType::Removed => 1,\n            ChangelogType::Internal => 0,\n        }\n    }\n}\n\nimpl cmp::PartialOrd for ChangelogType {\n    fn partial_cmp(&self, other: &ChangelogType) -> Option<cmp::Ordering> {\n        Some(self.cmp(other))\n    }","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/cross-rs/cross/blob/8c1a8aa4b661711f4b7b6ac07c2e8929ce2f7d27/xtask/src/changelog.rs#L109-L145","documentation":"ChangelogType::from_header converts a '### ' markdown header in a changelog into a ChangelogType enum. Only Added, Changed, Fixed, Removed and Internal are recognized; any other section title causes this bail. It enforces a fixed changelog section vocabulary for release note generation.","triggerScenarios":"read_changelog encounters a line like '### Security' or '### Deprecated' (or a misspelled/translated section name) and passes the header text to from_header.","commonSituations":"Contributors add a new section to CHANGELOG.md following common Keep-a-Changelog conventions (Security, Deprecated) that this project does not support; typos like '### Fixeds'; localized section names.","solutions":["Rename the header to one of the supported sections: Added, Changed, Fixed, Removed, Internal","Fix typos or casing in the changelog header (matching is exact)","If a new section is genuinely needed, add a ChangelogType variant and from_header arm plus a sort_by entry"],"exampleFix":"// before\n### Security\n- bumped dependency\n// after\n### Fixed\n- bumped dependency (security fix)","handlingStrategy":"validation","validationCode":"const ALLOWED: [&str; 5] = [\"Added\", \"Changed\", \"Fixed\", \"Removed\", \"Internal\"];\nassert!(ALLOWED.contains(&header), \"unsupported changelog section: {header}\");","typeGuard":"fn is_valid_section(header: &str) -> bool {\n    matches!(header, \"Added\" | \"Changed\" | \"Fixed\" | \"Removed\" | \"Internal\")\n}","tryCatchPattern":"match ChangelogType::from_header(header) {\n    Ok(t) => kind = Some(t),\n    Err(e) => eprintln!(\"skipping unsupported section {header:?}: {e}\"),\n}","preventionTips":["Restrict changelog sections to the five supported headings via a lint/CI check","Copy sections from an existing release rather than the upstream Keep-a-Changelog template","Fix casing exactly — matching is case-sensitive"],"tags":["changelog","parse","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"8c1a8aa4b661711f4b7b6ac07c2e8929ce2f7d27","analyzedAt":"2026-09-13T15:10:43.988Z","contentChangedAt":"2026-09-13T15:10:43.988Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}