Skip to content

Conversation

@frodoagu
Copy link

@frodoagu frodoagu commented Jul 22, 2025

This pull request introduces a new configuration option, HideRootPath, to the Index handler, allowing the application to conditionally hide the root path by returning a 404 response. The changes also ensure the Config field is properly initialized in relevant handlers.

This relates to #992

New feature: Conditional hiding of the root path

  • server/handler/index.go: Added a Config field to the Index struct to access configuration options.
  • server/handler/index.go: Updated the ServeHTTP method of the Index handler to check the HideRootPath configuration and return a 404 response if it is set to true.

Initialization updates

  • server/server.go: Ensured the Config field is initialized in the Index handler during server setup.

@palantirtech
Copy link
Member

Thanks for your interest in palantir/policy-bot, @frodoagu! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

ClientSecret string `yaml:"client_secret" json:"clientSecret"`
} `yaml:"oauth" json:"oauth"`

HideRootPath bool `yaml:"hide_root_path" json:"hideRootPath"`
Copy link
Member

Choose a reason for hiding this comment

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

this is not the right location to add this change. You need to update the config in https://github.com/palantir/policy-bot/blob/develop/server/config.go

Copy link
Author

@frodoagu frodoagu Jul 22, 2025

Choose a reason for hiding this comment

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

@asvoboda Just realized that I modified a go package, should I submit a PR to palantir/go-githubapp? seems that there is the place where the env variables are read from

Copy link
Member

Choose a reason for hiding this comment

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

No, your changes should be able to fit entirely within this repo. I'd recommend reading https://github.com/palantir/policy-bot?tab=readme-ov-file#development to get policy bot to run locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants