Git Product home page Git Product logo

Comments (4)

nejch avatar nejch commented on September 26, 2024 1

@1ace they're different objects because they're created from different endpoints, and don't necessarily have the same amount of details returned (or even the same attribute structure, as we've found out recently with merge request reviewer details returned from different endpoints). So it could be a bit confusing changing the object attributes dynamically like that. And the GitLab API is too inconsistent for us to assume they could be considered the same type of object IMO.

We sort of follow the REST API path segment structure for the most part with this approach. We also document this a bit:

image

This is far from the only case, so if we wanted to be consistent here, we would have to add this path hack to almost every endpoint where similar-but-not-quite-the-same resources are returned. This is why for now we simply document how to get an editable resource when fetched from a different endpoint:

https://python-gitlab.readthedocs.io/en/stable/faq.html#i-cannot-edit-the-merge-request-issue-i-ve-just-retrieved

However, if refresh() is needed for ProjectJob we should be able to add that. But technically there is no single GET call for /pipelines/:id/jobs/:job_id and this is why we don't have a refresh mixin for that one.

from python-gitlab.

1ace avatar 1ace commented on September 26, 2024

While trying to understand the code to find a better fix for the above, I noticed that ProjectJob's .play() also doesn't update the job status; #2784 fixes that

from python-gitlab.

1ace avatar 1ace commented on September 26, 2024

I don't understand why ProjectPipelineJob exists though; why doesn't ProjectPipelineJobManager.list() return a list of ProjectJob?
That would resolve a bunch of limitations, and I don't see the downside/blocker for doing that, so I must be missing something 😅

from python-gitlab.

nejch avatar nejch commented on September 26, 2024

@1ace with #2784 merged, does this cover your use case along with the docs above?

from python-gitlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.