Bug 2007647 - oc adm release info --changes-from does not show changes in repos that squash-merge
Summary: oc adm release info --changes-from does not show changes in repos that squash...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: Arda Guclu
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-24 13:21 UTC by Petr Muller
Modified: 2022-08-10 10:38 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 10:37:47 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 1116 0 None Merged Bug 2007647: Add squash-merge support into oc adm release info 2022-04-27 08:19:22 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:38:04 UTC

Description Petr Muller 2021-09-24 13:21:35 UTC
Description of problem:

"oc adm release info --changes-from" assumes the Git repositories that back the images merge changes with merge commits: it uses `git log --merges ...` to list the changes:

https://github.com/openshift/oc/blob/538ee42d982c248a704a106a60aba40c513da8b1/pkg/cli/admin/release/git.go#L177

Some repositories (like openshift/insights-operator) are using squash merges, so resulting commit history does not contain merge commits, so the changelog obtained via `oc adm release info` does not contain anything for images built from such repositories.

Version-Release number of selected component (if applicable):

$ oc version
Client Version: 4.8.0-202109210857.p0.git.88e7eba.assembly.stream-88e7eba

^^^ is my workstation but it looks like the current code has the problem too

How reproducible:
always

Steps to Reproduce:
1. oc adm release info --changelog=/tmp/changes --changes-from=registry.ci.openshift.org/ocp/release:4.7.0-0.ci-2021-09-22-002107 registry.ci.openshift.org/ocp/release:4.7.0-0.ci-2021-09-22-183042

Actual results:

The command recognized there was a different revision but does not print any changelog for that repo:

Cloning into '/tmp/changes/github.com/openshift/insights-operator'...
remote: Enumerating objects: 36761, done.
remote: Counting objects: 100% (5945/5945), done.
remote: Compressing objects: 100% (3266/3266), done.
remote: Total 36761 (delta 2643), reused 5067 (delta 2368), pack-reused 30816
Receiving objects: 100% (36761/36761), 40.98 MiB | 10.50 MiB/s, done.
Resolving deltas: 100% (16333/16333), done.

$ git log --merges --topo-order -z  19b13a7cf1bd5f38a4f1bc4f257ff7fd70803093..acf24a5ca7d9ab4428fa3f55f4f302a9e6e471bf

Expected results:
$ git log --topo-order -z  19b13a7cf1bd5f38a4f1bc4f257ff7fd70803093..acf24a5ca7d9ab4428fa3f55f4f302a9e6e471bf
commit acf24a5ca7d9ab4428fa3f55f4f302a9e6e471bf (HEAD -> release-4.7, origin/release-4.7)
Author: Tomas Remes <tremes.github.com>
Date:   Wed Sep 22 20:26:36 2021 +0200

    [release-4.7] Bug 2002539: Gather installed PSP names (#489) (#493)


Additional info:

Comment 1 Maciej Szulik 2021-09-27 14:14:03 UTC
We can't simply switch to `--no-merges` since that would provide a longer history, from all commits. The decision to use `--merges` was to only show summaries. We'll need to figure out a better approach to this.

Comment 2 Petr Muller 2021-09-27 15:47:13 UTC
Perhaps we could fall back to `--no-merges` when `--merges` ends up empty?

Comment 3 Michal Fojtik 2021-11-22 13:09:29 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Whiteboard if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 4 Petr Muller 2021-11-22 13:54:28 UTC
IMO still relevant, there is tooling that exposes this information to users

Comment 5 Michal Fojtik 2021-12-22 14:22:28 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Whiteboard if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 6 brad.williams 2022-01-03 16:03:12 UTC
IMO this is still relevant, there is tooling, specifically the release-controller, that exposes this information to users.

Comment 8 Michal Fojtik 2022-02-07 07:23:19 UTC
This bug hasn't had any activity in the last 30 days. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're marking this bug as "LifecycleStale" and decreasing the severity/priority. If you have further information on the current state of the bug, please update it, otherwise this bug can be closed in about 7 days. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. Additionally, you can add LifecycleFrozen into Whiteboard if you think this bug should never be marked as stale. Please consult with bug assignee before you do that.

Comment 9 Petr Muller 2022-02-07 08:49:18 UTC
What Brad said

Comment 10 Arda Guclu 2022-04-25 11:03:05 UTC
To understand the problem, I'm trying to find a suitable release(includes diffs to return data for oc adm release info command) to work on for insights-operator.

For example, this PR https://github.com/openshift/insights-operator/pull/605 was merged 5 days ago and I'd expect to see it in changelogs in 4.10 nightly releases https://amd64.ocp.releases.ci.openshift.org/#4.10.0-0.nightly. 

Only I could have found is that insights-operator is in "rebuilt images without code changes" section ie. https://amd64.ocp.releases.ci.openshift.org/releasestream/4.10.0-0.nightly/release/4.10.0-0.nightly-2022-04-20-102855

Does this https://amd64.ocp.releases.ci.openshift.org/releasestream/ page also use `oc adm release info` to calculate change logs(and thus this is the same problem) or I'm looking at incorrect releases and just have to wait new PR getting merged for insights-operator?

Comment 11 brad.williams 2022-04-25 12:19:24 UTC
Yes, the release-controller generates the change logs via a "oc adm release info --changelog=/tmp/git <from> <to>" command:
https://github.com/openshift/release-controller/blob/a0977a69eeedbc793483ba0229989b1fa14ac2eb/pkg/release-controller/release_info.go#L175-L214

Comment 12 Arda Guclu 2022-04-25 14:44:14 UTC
Thanks @Brad.

I think, I could have reproduced problem with these releases;
oc adm release info --changelog=/tmp/changes --changes-from=registry.ci.openshift.org/ocp/release:4.11.0-0.nightly-2022-04-21-192140 registry.ci.openshift.org/ocp/release:4.11.0-0.nightly-2022-04-22-002610

Comment 16 Arda Guclu 2022-04-28 12:11:13 UTC
I've verified bug is fixed with running the command;

$ oc adm release info --changelog=/tmp/changes --changes-from=registry.ci.openshift.org/ocp/release:4.11.0-0.nightly-2022-04-26-181148 registry.ci.openshift.org/ocp/release:4.11.0-0.nightly-2022-04-28-102605

Cloning into '/tmp/changes/github.com/openshift/insights-operator'...
remote: Enumerating objects: 39597, done.
remote: Total 39597 (delta 0), reused 0 (delta 0), pack-reused 39597
Receiving objects: 100% (39597/39597), 41.07 MiB | 1.31 MiB/s, done.
Resolving deltas: 100% (19188/19188), done.
### [insights-operator](https://github.com/openshift/insights-operator/tree/14d32dcb8c54eba7aeca1cb140167ea81d6799b2)

* [Bug 2079315](https://bugzilla.redhat.com/show_bug.cgi?id=2079315): Gather ODF config data (#614) [#614](https://github.com/openshift/insights-operator/pull/614)
* [Full changelog](https://github.com/openshift/insights-operator/compare/95961e7113ce179bf1621ac38842cad691d5b870...14d32dcb8c54eba7aeca1cb140167ea81d6799b2)


But I could not see insights-operator changes in that list;

https://amd64.ocp.releases.ci.openshift.org/releasestream/4.11.0-0.nightly/release/4.11.0-0.nightly-2022-04-28-102605?from=4.11.0-0.nightly-2022-04-26-181148

Is it possible that release-controller is not using the latest oc binary?

Comment 17 brad.williams 2022-04-28 12:39:54 UTC
Hey @Ardag

Comment 18 brad.williams 2022-04-28 12:41:37 UTC
Arda,
Yes, unfortunately the release-controller was running a very old version of `oc` for about the last week.  I have corrected the problem and you should be able to verify now:

```
sh-4.4$ oc version
Client Version: v4.2.0-alpha.0-1457-g9b7fe72
Kustomize Version: v4.5.4
Kubernetes Version: v1.23.5+9ce5071
```

Comment 19 zhou ying 2022-04-28 13:34:13 UTC
Arda Guclu:

Thanks , double confirmed , the issue has fixed:
oc adm release info --changelog=/home/changes --changes-from=registry.ci.openshift.org/ocp/release:4.11.0-0.nightly-2022-04-26-181148 registry.ci.openshift.org/ocp/release:4.11.0-0.nightly-2022-04-28-102605

......

Cloning into '/home/changes/github.com/openshift/insights-operator'...
remote: Enumerating objects: 39597, done.
remote: Total 39597 (delta 0), reused 0 (delta 0), pack-reused 39597
Receiving objects: 100% (39597/39597), 41.07 MiB | 11.76 MiB/s, done.
Resolving deltas: 100% (19188/19188), done.
### [insights-operator](https://github.com/openshift/insights-operator/tree/14d32dcb8c54eba7aeca1cb140167ea81d6799b2)

* [Bug 2079315](https://bugzilla.redhat.com/show_bug.cgi?id=2079315): Gather ODF config data (#614) [#614](https://github.com/openshift/insights-operator/pull/614)
* [Full changelog](https://github.com/openshift/insights-operator/compare/95961e7113ce179bf1621ac38842cad691d5b870...14d32dcb8c54eba7aeca1cb140167ea81d6799b2)

 oc version --client
Client Version: 4.11.0-202204270610.p0.g9b7fe72.assembly.stream-9b7fe72
Kustomize Version: v4.5.4

Comment 22 errata-xmlrpc 2022-08-10 10:37:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069


Note You need to log in before you can comment on or make changes to this bug.