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

frontend: fix /build/source-chroot/ endpoint #3578

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

FrostyX
Copy link
Member

@FrostyX FrostyX commented Jan 7, 2025

As reported by @nforro, this tracebacks because of not existing endpoint.

from copr.v3 import Client as CoprClient
copr_client = CoprClient.create_from_config_file()
copr_client.build_proxy.get_source_chroot(8481944)

For some reason this endpoint was renamed from /build/source-chroot to /build/source-log in 7455d47. I suppose it was a typo?

As reported by @nforro, this tracebacks because of not existing endpoint.

    from copr.v3 import Client as CoprClient
    copr_client = CoprClient.create_from_config_file()
    copr_client.build_proxy.get_source_chroot(8481944)

For some reason this endpoint was renamed from `/build/source-chroot` to
`/build/source-log` in 7455d47. I suppose it was a typo?
@FrostyX
Copy link
Member Author

FrostyX commented Jan 7, 2025

I hotfixed it as

--- /usr/share/copr/coprs_frontend/coprs/views/apiv3_ns/apiv3_builds.py 2024-10-03 00:00:00.000000000 +0000
+++ /usr/share/copr/coprs_frontend/coprs/views/apiv3_ns/apiv3_builds.py 2025-01-07 18:08:35.015963178 +0000
@@ -187,6 +187,7 @@


 @apiv3_builds_ns.route("/source-log/<int:build_id>")
+@apiv3_builds_ns.route("/source-chroot/<int:build_id>")
 class SourceChroot(Resource):
     @apiv3_builds_ns.doc(params=get_build_docs)
     @apiv3_builds_ns.marshal_with(source_chroot_model)

(not removing the currently deployed route, only adding the previous one)

Copy link
Member

@xsuchy xsuchy left a comment

Choose a reason for hiding this comment

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

+1

@praiskup
Copy link
Member

praiskup commented Jan 8, 2025

waiting for @nikromen to review this (might be an intentional change)
praiskup tends to keep the old path, just in case

Copy link
Member

@nikromen nikromen left a comment

Choose a reason for hiding this comment

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

oops, sorry. Yes this seems like a typo, if I needed to intentionally change it, I'd deprecated the old endpoint to not break backward compatibility (like with some REST API methods in our docs). Thanks!

@praiskup
Copy link
Member

On Frontend:
for i in access_log-202*; do gunzip < $i | grep /source-log/; done

No hit; apparently no one visits the old path (no need to keep the backward compat). Merging.

@praiskup praiskup merged commit ff240d3 into fedora-copr:main Jan 13, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants