Renamed or removed Environments are sent DELETE requests in nop mode

Open
#799 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
api, backend

Research direction

Trace the nop-mode handling for pull request check runs and follow how renamed or removed environments reach the environment REST endpoint. Confirm the no-op path does not send DELETE requests when environments are absent from the configuration, using the reported logs and expected behavior as the completion check.

Written by the indexing model from the issue text.

Description

bug

Problem Description

As per the title, when Environments are renamed or removed entirely in the config and the app is executed in nop mode via a pull request check run, the environment will be deleted from the associated repositories.

What is actually happening

As per the title, when Environments are renamed or removed entirely in the config and the app is executed in nop mode via a pull request check run, the environment REST endpoint will be sent a DELETE request.

What is the expected behavior

In nop mode no changes should be made to repository settings.

Error output, if available

Not errors, but these logs were generated on a no-op dry run of safe-settings where balena-staging.com+sign-api-key had been deleted from the settings.

{"level":20,"time":1740682249048,"pid":24,"hostname":"safe-settings-d86c9d9d7-bwdrd","name":"probot","name":"probot","name":"octokit","msg":"GitHub request: DELETE https://api.github.com/repos/balena-os/balena-iot-gate-imx8plus/environments/balena-staging.com%2Bsign-api-key - 204"}
2025-02-27 13:50:48.103	
{"level":20,"time":1740682248103,"pid":24,"hostname":"safe-settings-d86c9d9d7-bwdrd","name":"probot","name":"probot","name":"octokit","msg":"GitHub request: DELETE https://api.github.com/repos/balena-os/balena-iot-gate-imx8plus/environments/balena-cloud.com%2Bsign-api-key - 204"}
2025-02-27 13:50:41.042	
{"level":20,"time":1740682241041,"pid":24,"hostname":"safe-settings-d86c9d9d7-bwdrd","name":"probot","name":"probot","name":"octokit","msg":"GitHub request: DELETE https://api.github.com/repos/balena-os/balena-iot-gate-imx8/environments/balena-staging.com%2Bsign-api-key - 204"}

Context

Are you using the hosted instance of probot/settings or running your own?

Self-hosted

If running your own instance, are you using it with github.com or GitHub Enterprise?

github.com

Version of probot/settings

We previously thought this issue had been addressed here: https://github.com/github/safe-settings/pull/691

Last reproduced in https://github.com/github/safe-settings/releases/tag/2.1.16

Version of GitHub Enterprise
Dominant language
JavaScript
Stars
942
Forks
238
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github-community-projects/safe-settings

All issues in github-community-projects/safe-settings

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.