@@ -50,21 +50,34 @@ export async function createChangelogEntry(
5050 // Generate changes between the two schemas
5151 const changes = await diff ( oldSchema , newSchema )
5252 const changesToReport = [ ]
53+ const ignoredChanges = [ ]
5354 changes . forEach ( ( change ) => {
5455 if ( CHANGES_TO_REPORT . includes ( change . type ) ) {
5556 changesToReport . push ( change )
56- } else if ( CHANGES_TO_IGNORE . includes ( change . type ) ) {
57- // Do nothing
5857 } else {
59- console . error ( 'Change object causing error:' )
60- console . error ( change )
61- throw new Error (
62- 'This change type should be added to CHANGES_TO_REPORT or CHANGES_TO_IGNORE: ' +
63- change . type ,
64- )
58+ // Track ignored changes for visibility
59+ ignoredChanges . push ( change )
6560 }
6661 } )
6762
63+ // Log warnings for ignored change types to provide visibility
64+ if ( ignoredChanges . length > 0 ) {
65+ const ignoredTypes = [ ...new Set ( ignoredChanges . map ( ( change ) => change . type ) ) ]
66+ console . warn (
67+ `⚠️ GraphQL changelog: Ignoring ${ ignoredChanges . length } changes of ${ ignoredTypes . length } type(s):` ,
68+ )
69+ ignoredTypes . forEach ( ( type ) => {
70+ const count = ignoredChanges . filter ( ( change ) => change . type === type ) . length
71+ console . warn ( ` - ${ type } (${ count } change${ count > 1 ? 's' : '' } )` )
72+ } )
73+ console . warn (
74+ ' These change types are not in CHANGES_TO_REPORT and will not appear in the changelog.' ,
75+ )
76+ }
77+
78+ // Store ignored changes for potential workflow outputs
79+ createChangelogEntry . lastIgnoredChanges = ignoredChanges
80+
6881 const { schemaChangesToReport, previewChangesToReport } = segmentPreviewChanges (
6982 changesToReport ,
7083 previews ,
@@ -276,40 +289,36 @@ const CHANGES_TO_REPORT = [
276289 ChangeType . DirectiveUsageFieldDefinitionRemoved ,
277290]
278291
279- const CHANGES_TO_IGNORE = [
280- ChangeType . FieldArgumentDescriptionChanged ,
281- ChangeType . DirectiveRemoved ,
282- ChangeType . DirectiveAdded ,
283- ChangeType . DirectiveDescriptionChanged ,
284- ChangeType . DirectiveLocationAdded ,
285- ChangeType . DirectiveLocationRemoved ,
286- ChangeType . DirectiveArgumentAdded ,
287- ChangeType . DirectiveArgumentRemoved ,
288- ChangeType . DirectiveArgumentDescriptionChanged ,
289- ChangeType . DirectiveArgumentDefaultValueChanged ,
290- ChangeType . DirectiveArgumentTypeChanged ,
291- ChangeType . DirectiveUsageArgumentDefinitionRemoved ,
292- ChangeType . EnumValueDescriptionChanged ,
293- ChangeType . EnumValueDeprecationReasonChanged ,
294- ChangeType . EnumValueDeprecationReasonAdded ,
295- ChangeType . EnumValueDeprecationReasonRemoved ,
296- ChangeType . FieldDescriptionChanged ,
297- ChangeType . FieldDescriptionAdded ,
298- ChangeType . FieldDescriptionRemoved ,
299- ChangeType . FieldDeprecationAdded ,
300- ChangeType . FieldDeprecationRemoved ,
301- ChangeType . FieldDeprecationReasonChanged ,
302- ChangeType . FieldDeprecationReasonAdded ,
303- ChangeType . FieldDeprecationReasonRemoved ,
304- ChangeType . InputFieldDescriptionAdded ,
305- ChangeType . InputFieldDescriptionRemoved ,
306- ChangeType . InputFieldDescriptionChanged ,
307- ChangeType . TypeDescriptionChanged ,
308- ChangeType . TypeDescriptionRemoved ,
309- ChangeType . TypeDescriptionAdded ,
310- ChangeType . DirectiveUsageFieldDefinitionAdded ,
311- ChangeType . DirectiveUsageArgumentDefinitionAdded ,
312- ChangeType . DirectiveUsageEnumValueAdded ,
313- ]
292+ // CHANGES_TO_IGNORE list removed - now we only process changes explicitly listed
293+ // in CHANGES_TO_REPORT and silently ignore all others for future compatibility
294+
295+ /**
296+ * Get the ignored change types from the last changelog entry creation
297+ * @returns {Array } Array of ignored change objects
298+ */
299+ export function getLastIgnoredChanges ( ) {
300+ return createChangelogEntry . lastIgnoredChanges || [ ]
301+ }
302+
303+ /**
304+ * Get summary of ignored change types for workflow outputs
305+ * @returns {Object } Summary with counts and types
306+ */
307+ export function getIgnoredChangesSummary ( ) {
308+ const ignored = getLastIgnoredChanges ( )
309+ if ( ignored . length === 0 ) return null
310+
311+ const types = [ ...new Set ( ignored . map ( ( change ) => change . type ) ) ]
312+ const summary = {
313+ totalCount : ignored . length ,
314+ typeCount : types . length ,
315+ types : types . map ( ( type ) => ( {
316+ type,
317+ count : ignored . filter ( ( change ) => change . type === type ) . length ,
318+ } ) ) ,
319+ }
320+
321+ return summary
322+ }
314323
315324export default { createChangelogEntry, cleanPreviewTitle, previewAnchor, prependDatedEntry }
0 commit comments