#452 [cli] fix copr mock-config no. 3
Merged 5 years ago by msuchy. Opened 5 years ago by clime.

[cli] fix copr mock-config
clime • 5 years ago  
file modified
+8 -2
@@ -406,8 +406,14 @@ 

          """

          sys.stderr.write("# This command is deprecated and will be removed in a future release.\n")

          ownername, projectname = self.parse_name(args.project)

-         build_config = self.client.project_chroot_proxy.get_build_config(ownername, projectname, args.chroot)

-         print(MockProfile(build_config))

+         client = CoprClient.create_from_file_config()

+         result = client.get_build_config('{0}/{1}'.format(ownername, projectname), args.chroot)

+ 

+         if result.output != "ok":

+             sys.stderr.write(result.error + "\n")

+             sys.stderr.write("Un-expected data returned, please report this issue\n")

+ 

+         print(MockProfile(result.build_config))

  

  

      @check_username_presence

This PR fixes copr mock-config command by using the old CoprClient. See discussion in PR#450.

Fixes issue: #427 copr-cli: broken mock-config after switch to api-v3


(Who would think I would be the one fixing the command:)

Trust me that I've been thinking about this multiple times; but this is not good thing.

Merging this would mean that we plan to stop the support for the API needed to actually correctly implement the feature. For this clear -1, it is backwards.

Let's concentrate on #428 and #450, and please, please - let me sort it out (the feature is going to be undeprecated, tested and properly documented).

Trust me that I've been thinking about this multiple times; but this is not good thing.
Merging this would mean that we plan to stop the support for the API needed to actually correctly implement the feature. For this clear -1, it is backwards.

Pavel, we can merge this and then still fix the API to provide expanded additional repos.

As for currently non-working copr mock-config, this PR is the most straightforward/simple fix, which should count for a release blocker.

The other PRs for this are rather improving copr-rpmbuild and the API, which is a good thing to do but it is also not a completely necessary thing to do right now (but we can do it also, why not).

I dislike the the overall status with unwanted copr mock-config feature, and this another attempt to kill that entirely, but that's not the plan.

For me, there's no reason to go back to API v1, just small API v3 fix is needed.

As for currently non-working copr mock-config, this PR is the most straightforward/simple fix, which should count for a release blocker.

Thats true. But we all have also agreed on changes made in PR#450 so AFAIK we only need to figure out two attribute names and the PR is ready to go.

But we all have also agreed on changes made in PR#450

PR#450 is doing work on a deprecated code/feature, which is a part I don't agree with.

Pull-Request has been merged by msuchy

5 years ago
Metadata