nephio-project / nephio

Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
93 stars 52 forks source link

upstream/downstream information is missing in porch/CaD for packages created using `kpt CLI` #629

Open liamfallon opened 2 months ago

liamfallon commented 2 months ago

Original issue URL: https://github.com/kptdev/kpt/issues/3571 Original issue user: https://github.com/droot Original issue created at: 2022-09-21T21:17:51Z Original issue last updated at: 2022-11-15T22:07:48Z Original issue body: I have three repositories:

The packages base-app , frontend and frontend-dev were created and published entirely using kpt CLI. I registered the three repositories in porch through CaD UI.

I expect upstream/downstream information for base-app, frontend and frontend-dev to be present while browsing the blueprints through the UI but it seems to be missing.

Another thing is while creating a revision of frontend, diff view shows resources to be been removed (shown below) while I do see the resources in the revision (might be related to upstream/downstream info).

image

/cc @mortent @ChristopherFry

Original issue comments: Comment user: https://github.com/ChristopherFry Comment created at: 2022-09-23T16:28:22Z Comment last updated at: 2022-09-23T16:28:22Z Comment body: Taking a quick look, I do see why the packages are not showing upstream/downstream information the UI (and same would be true using the Porch CLI).

Looking at the Kptfile for frontend team blueprint specifically (snippet of upstreamLock below), this package was created from pulling the main branch of your platform blueprints repository. Porch does expect packages to be created from tagged versions of an upstream package, such as base-app/v0 from the platform blueprints repository. The same is true with your package in the deployment repository.

upstreamLock:
  type: git
  git:
    repo: git@github.com:platkrm/boa-platform-blueprints
    directory: /base-app
    ref: main
    commit: b12f8ab6417165848bbb408d4d5cad9ef739c944

Also, your packages were created using ssh which Porch does not currently support (#3232 will add this support). This can impact the logic that is used for upstream and downstream packages since we perform matching on the repository field, and with the git urls being different between https and ssh, and since Porch only supports repositories registered with https, this will also cause the match to fail. I can potentially update the logic to handle this scenario, but since ssh isn't supported yet, I am hesitant to.

Additionally, there is a known issue where the upstreamLock has slight format differences when a package is created with kpt pkg get versus with Porch (#3501) which can previously cause the UI to also fail to find upstream and downstream packages. I just updated the UI to be able to ignore this difference so as long as you have latest, this will no longer be an issue.