Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Improve VCS info captured by acorn when building images #1622

Closed
njhale opened this issue May 18, 2023 · 4 comments
Closed

Improve VCS info captured by acorn when building images #1622

njhale opened this issue May 18, 2023 · 4 comments
Labels
area/events kind/enhancement New feature or request
Milestone

Comments

@njhale
Copy link
Contributor

njhale commented May 18, 2023

When building images, acorn captures some very basic VCS info about the repository in the current working directory. Today, this denotes only:

  1. The commit hash of HEAD
  2. Whether the working directory has uncommitted changes

We want to enrich the set of info captured to include:

  • A reference to the upstream [remote]
  • Whether the workspace is "clean" -- meaning NO non-ignored local files -- or not

See also: vcs.go

@njhale njhale added the kind/enhancement New feature or request label May 18, 2023
@cjellick cjellick added this to the v0.7.0 milestone May 19, 2023
@sangee2004
Copy link
Contributor

sangee2004 commented May 31, 2023

Tested with - acorn version v0.7.0-alpha1-118-g6adb3fe9+6adb3fe9

AppImagePullSuccess event now includes the following information in "vcs" section:

            "vcs": {
                "modified": true,
                "remotes": [
                    "git@github.com:sangee2004/hub.git",
                    "git@github.com:acorn-io/hub.git"
                ],
                "revision": "c6a2c32111362fad04967b7832cd0854662c83b4"
            }

There is 1 issue with "modified" always being reported as "true".

Scenarios:

  1. Deploy app from git hub repo without making any local changes.

previous:

            "vcs": {}
        },

target:

            "vcs": {
                "modified": true,
                "remotes": [
                    xx
                ],
                "revision": "c6a2c32111362fad04967b7832cd0854662c83b4"
            }

In this case we expect "modified": false for "target"

  1. Make some local changes but do not commit the changes.
        "previous": {
            "digest": "sha256:19eef54625c3132a759374490db3af209e5e974acb794381dc9c5a9be9f006fe",
            "name": "19eef54625c3132a759374490db3af209e5e974acb794381dc9c5a9be9f006fe",
            "vcs": {
                "modified": true,
                "remotes": [xxx
                ],
                "revision": "32c5239dc55b4a8f5981b657c5822237a4589f7d"
            }
        },
        "resourceVersion": "1222348",
        "target": {
            "digest": "sha256:80c8da7939201347c9f2e7060dbdaee55fba8f38a13eee1aabe82e038a531b0b",
            "name": "80c8da7939201347c9f2e7060dbdaee55fba8f38a13eee1aabe82e038a531b0b",
            "vcs": {
                "modified": true,
                "remotes": [
                   xxx
                ],
                "revision": "32c5239dc55b4a8f5981b657c5822237a4589f7d"
            }
        }

In this case "modified": true in target is correct.

  1. Make some local changes and commit the changes.
        "previous": {
            "digest": "sha256:80c8da7939201347c9f2e7060dbdaee55fba8f38a13eee1aabe82e038a531b0b",
            "name": "80c8da7939201347c9f2e7060dbdaee55fba8f38a13eee1aabe82e038a531b0b",
            "vcs": {
                "modified": true,
                "remotes": [xx
                ],
                "revision": "32c5239dc55b4a8f5981b657c5822237a4589f7d"
            }
        },
        "resourceVersion": "1222419",
        "target": {
            "digest": "sha256:e139ea12b833c10addc3c349d536080c3569dd75e0cd8a764bb83029aef9b7b9",
            "name": "e139ea12b833c10addc3c349d536080c3569dd75e0cd8a764bb83029aef9b7b9",
            "vcs": {
                "modified": true,
                "remotes": [xx
                ],
                "revision": "c6a2c32111362fad04967b7832cd0854662c83b4"
            }
        }

In this case we expect "modified": false for "target".

Note - Even when I push the changes and deploy Apps , I see the "modified": true for the AppImagePullSuccess events.

@cjellick
Copy link
Member

cjellick commented Jun 5, 2023

@njhale moving out to v0.8

@cjellick cjellick modified the milestones: v0.7.0, v0.8.0 Jun 5, 2023
@cjellick cjellick modified the milestones: v0.8.0, Backlog Aug 25, 2023
@cjellick
Copy link
Member

This might tie into our improve github oidc integration story

@cjellick
Copy link
Member

extracting modified bug into it's own issue: #2336

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/events kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants