Skip to content

Conversation

@Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Dec 16, 2025

Summary

Enforces stricter filename validation to ensure consistency across documentation files. Filenames must now:

  • Be lowercase
  • Start with an alphanumeric character or underscore
  • Contain only alphanumeric characters, spaces, dashes, dots, and underscores

This PR adds validation for both the full file path and the filename itself, catching issues like uppercase letters in directory names and invalid starting characters.

Changes

  • Added FilePathRegex to validate the full path (lowercase, valid characters)
  • Added FileNameRegex to validate the filename starts with [a-z0-9_]
  • Combined both validations in IsValidFileName
  • Extended test coverage with 140 theory-based test cases

Test plan

  • All OutputDirectoryTests pass (140 tests)
  • Validation correctly rejects uppercase in paths and filenames
  • Validation correctly rejects filenames starting with hyphens, dots, or spaces

Files requiring updates in other repositories

The following files have leading underscores and need to be renamed before we can make the check strictly alphanumeric (removing underscore from allowed starting characters):

elasticsearch

  • docs/reference/elasticsearch-plugins/_reimplementing_and_extending_the_analyzers.md
  • docs/reference/elasticsearch-plugins/_other_command_line_parameters.md
  • docs/reference/elasticsearch-plugins/_plugins_directory.md
  • docs/reference/elasticsearch-plugins/_reimplementing_and_extending_the_analyzers_2.md

integrations

  • docs/extend/_publish_an_integration.md

docs-content

  • deploy-manage/tools/cross-cluster-replication/_failback_when_clustera_comes_back.md
  • deploy-manage/tools/cross-cluster-replication/_failback_when_clustera_comes_back_2.md
  • deploy-manage/tools/cross-cluster-replication/_prerequisites_14.md
  • deploy-manage/tools/cross-cluster-replication/_configure_privileges_for_cross_cluster_replication_2.md
  • deploy-manage/tools/cross-cluster-replication/_perform_update_or_delete_by_query.md
  • deploy-manage/tools/cross-cluster-replication/_failover_when_clustera_is_down.md
  • deploy-manage/tools/cross-cluster-replication/_failover_when_clustera_is_down_2.md
  • deploy-manage/tools/cross-cluster-replication/_connect_to_a_remote_cluster.md
  • troubleshoot/observability/apm/_collection_of_diagnostic_information.md
  • troubleshoot/observability/apm/_agent_is_not_instrumenting_code.md
  • reference/fleet/_agent_configuration_encryption.md

beats

  • docs/reference/metricbeat/_host_setup.md
  • docs/reference/metricbeat/_galera_status_metricset.md
  • docs/reference/metricbeat/_live_reloading.md
  • docs/reference/metricbeat/_metricsets_70.md
  • docs/reference/filebeat/_live_reloading.md
  • docs/reference/filebeat/_set_up_the_oauth_app_in_the_salesforce_2.md
  • docs/extend/_migrating_dashboards_from_kibana_5_x_to_6_x.md

ecs-dotnet

  • docs/reference/_enrichers_2.md
  • docs/reference/_usage.md
  • docs/reference/_extending_ecsdocument.md
  • docs/reference/_formatters.md
  • docs/reference/_elasticsearch_security.md

ecs-logging-java

  • docs/reference/_structured_logging_with_log4j2.md

go-elasticsearch

  • docs/reference/_getting_started_with_the_api.md

elasticsearch-net

  • docs/reference/_options_on_elasticsearchclientsettings.md

Enforces stricter filename validation to ensure consistency across documentation files. Filenames must now:
- Be lowercase
- Start with an alphanumeric character or underscore
- Contain only alphanumeric characters, spaces, dashes, dots, and underscores

This PR adds validation for both the full file path and the filename itself, catching issues like uppercase letters in directory names and invalid starting characters.

- Added `FilePathRegex` to validate the full path (lowercase, valid characters)
- Added `FileNameRegex` to validate the filename starts with `[a-z0-9_]`
- Combined both validations in `IsValidFileName`
- Extended test coverage with 140 theory-based test cases

- [x] All `OutputDirectoryTests` pass (140 tests)
- [x] Validation correctly rejects uppercase in paths and filenames
- [x] Validation correctly rejects filenames starting with hyphens, dots, or spaces

The following files have leading underscores and need to be renamed before we can make the check strictly alphanumeric (removing underscore from allowed starting characters):

- `docs/reference/elasticsearch-plugins/_reimplementing_and_extending_the_analyzers.md`
- `docs/reference/elasticsearch-plugins/_other_command_line_parameters.md`
- `docs/reference/elasticsearch-plugins/_plugins_directory.md`
- `docs/reference/elasticsearch-plugins/_reimplementing_and_extending_the_analyzers_2.md`

- `docs/extend/_publish_an_integration.md`

- `deploy-manage/tools/cross-cluster-replication/_failback_when_clustera_comes_back.md`
- `deploy-manage/tools/cross-cluster-replication/_failback_when_clustera_comes_back_2.md`
- `deploy-manage/tools/cross-cluster-replication/_prerequisites_14.md`
- `deploy-manage/tools/cross-cluster-replication/_configure_privileges_for_cross_cluster_replication_2.md`
- `deploy-manage/tools/cross-cluster-replication/_perform_update_or_delete_by_query.md`
- `deploy-manage/tools/cross-cluster-replication/_failover_when_clustera_is_down.md`
- `deploy-manage/tools/cross-cluster-replication/_failover_when_clustera_is_down_2.md`
- `deploy-manage/tools/cross-cluster-replication/_connect_to_a_remote_cluster.md`
- `troubleshoot/observability/apm/_collection_of_diagnostic_information.md`
- `troubleshoot/observability/apm/_agent_is_not_instrumenting_code.md`
- `reference/fleet/_agent_configuration_encryption.md`

- `docs/release-notes/_snippets/9.2.0+build202510300150/deprecations.md`
- `docs/release-notes/_snippets/9.2.0+build202510300150/breaking-changes.md`
- `docs/release-notes/_snippets/9.2.0+build202510300150/index.md`

- `docs/reference/metricbeat/_host_setup.md`
- `docs/reference/metricbeat/_galera_status_metricset.md`
- `docs/reference/metricbeat/_live_reloading.md`
- `docs/reference/metricbeat/_metricsets_70.md`
- `docs/reference/filebeat/_live_reloading.md`
- `docs/reference/filebeat/_set_up_the_oauth_app_in_the_salesforce_2.md`
- `docs/extend/_migrating_dashboards_from_kibana_5_x_to_6_x.md`

- `docs/reference/_enrichers_2.md`
- `docs/reference/_usage.md`
- `docs/reference/_extending_ecsdocument.md`
- `docs/reference/_formatters.md`
- `docs/reference/_elasticsearch_security.md`

- `docs/reference/_structured_logging_with_log4j2.md`

- `docs/reference/_getting_started_with_the_api.md`

- `docs/reference/_options_on_elasticsearchclientsettings.md`
@Mpdreamz Mpdreamz requested a review from a team as a code owner December 16, 2025 17:00
@Mpdreamz Mpdreamz added the fix label Dec 16, 2025
@Mpdreamz Mpdreamz requested a review from reakaleek December 16, 2025 17:00
@Mpdreamz Mpdreamz self-assigned this Dec 16, 2025
Copy link
Contributor

@theletterf theletterf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a doc sweep be a requirement before we merge this?

Thinking of more scenarios such as unique anchors, etc.

@Mpdreamz
Copy link
Member Author

We should do a pass but we don't have to block merging this, we have allow listed the offenders for now.

cc @colleenmcginnis

@Mpdreamz Mpdreamz merged commit f6dc083 into main Dec 18, 2025
29 checks passed
@Mpdreamz Mpdreamz deleted the fix/enforce-lowercase-filenames branch December 18, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants