Skip to content

chore: added supoort for backup in update repo api #6462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 24, 2025

Conversation

Ash-exp
Copy link
Contributor

@Ash-exp Ash-exp commented Mar 21, 2025

Description

This PR does the below:

  • Better error handling for pipeline material
  • create backup for update repository request (payload driven)

Fixes https://github.com/devtron-labs/sprint-tasks/issues/1956

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?

Whenever we face an issue in git-sensor, where we need to update the application git-materials to unblock the client, instead of doing that from UI, we should the updated payload as below:

curl --location --request PUT '{{HOST_URL}}/orchestrator/app/material' \
--header 'Content-Type: application/json' \
--header 'Cookie: argocd.token={{TOKEN}}' \
--data '{
    "appId": 1,
    "material": {
        "id": 1,
        "url": "",
        "checkoutPath": "",
        "filterPattern": [],
        "gitProviderId": 2,
        "fetchSubmodules": false,
        "createBackup": true
    }
}'

Here createBackup flag creates the backup of the existing data and then performs the operation. It might take longer than the usual update repository API as it'll copy the directory.

nishant-d
nishant-d previously approved these changes Mar 24, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
13.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@Ash-exp Ash-exp changed the base branch from main to develop March 24, 2025 09:45
@Ash-exp Ash-exp changed the title added supoort for preserve mode in update repo api chore: added supoort for backup in update repo api Mar 24, 2025
@Ash-exp Ash-exp merged commit 1c29859 into develop Mar 24, 2025
12 of 13 checks passed
@Ash-exp Ash-exp deleted the chore-refactoring-git-watcher branch March 24, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants