Skip to content
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

Add technology parameter to filter copied files #4

Merged
merged 10 commits into from
Feb 7, 2025

Conversation

waodim
Copy link
Contributor

@waodim waodim commented Feb 3, 2025

Description

Ticket

With this a new parameter is added: technology

It is a comma separated list of technologies. If it is provided in a valid way, only those files will be copied over that have this technology. Namely, if the manifest.json looks like this (NOTE I assumed that the file has this structure, if it should not look like this please let me know.):

        "version": "1.0",
        "technologies": {
            "java": {
                "x86": [
                    {"path": "...", "version": "1.0", "md5": "..."}
                ]
            },
            "python": {
                "arm": [
                    {"path": "...", "version": "1.0", "md5": "..."}
                ]
            }
        }
    }

and you filter by only python, only the files that are stored under the key python will be copied over.

How can this be tested?

Unit tests are straight forward and test it properly IMO.

@waodim waodim added the enhancement New feature or request label Feb 3, 2025
@waodim waodim requested a review from a team as a code owner February 3, 2025 10:18
@waodim waodim mentioned this pull request Feb 3, 2025
pkg/move/cmd.go Outdated Show resolved Hide resolved
pkg/move/cmd.go Outdated Show resolved Hide resolved
pkg/move/cmd.go Outdated Show resolved Hide resolved
Moved every way of copying to its own file. Went for a new to distinguish between the ways of copying by passing a copy function as parameter; We now either copy simple, by tech or do the atomic (per file) way
pkg/move/atomic_test.go Outdated Show resolved Hide resolved
pkg/move/atomic_test.go Outdated Show resolved Hide resolved
pkg/move/technologies.go Outdated Show resolved Hide resolved
Copy link
Contributor

@0sewa0 0sewa0 left a comment

Choose a reason for hiding this comment

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

tested it, functionally LGTM:

  • with --technology=php
root@php-only-56d77fd9b8-zbv4l:/var/www/html# du -sh /opt/dynatrace/
195M    /opt/dynatrace/
  • without --technology=php
root@cm-all-677f997756-fdmsc:/var/www/html# du -sh /opt/dynatrace/
1.2G    /opt/dynatrace/

left some comments due the logging being a bit lacking

pkg/move/technologies.go Outdated Show resolved Hide resolved
pkg/move/technologies.go Outdated Show resolved Hide resolved
waodim and others added 2 commits February 6, 2025 13:30
Co-authored-by: Marcell Sevcsik <[email protected]>
Co-authored-by: Marcell Sevcsik <[email protected]>
@0sewa0 0sewa0 merged commit f503487 into main Feb 7, 2025
6 checks passed
@0sewa0 0sewa0 deleted the feature/add-technology-param branch February 7, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants