Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RefreshMixin.refresh() doesn't remove removed attributes #1155

Closed
@ericfrederich

Description

@ericfrederich

Description of the problem, including code/CLI snippet

When attributes disappear from an object on the serverRefreshMixin.refresh() doesn't remove them.

For instance if a job that has artifacts will have anartifacts_file attribute. If you call.delete_artifacts() on it, then call.refresh() theartifacts_file attribute will still be there.

# get a job with artifactsjob = project.jobs.get(job_id)# will succeedassert hasattr(job,"artifacts_file")# now delete the artifacts from the serverjob.delete_artifacts()# This will fail because the artifacts_file is still there; refresh() didn't remove itjob.refresh()assert not hasattr(job,"artifacts_file")# If you get the job again from the project it'll be finejob = project.jobs.get(job_id)assert not hasattr(job,"artifacts_file")

Expected Behavior

I would expect that the attributes dict on any object should be exactly the same between a freshly retrieved object and an old object after calling.refresh()

o.refresh()# After a refresh this should always be trueo.attributes==o.manager.get(o.id).attributes

Actual Behavior

They're not equal

Specifications

  • python-gitlab version:v2.4.0
  • API version you are using (v3/v4):v4
  • Gitlab server version (or gitlab.com):13.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp