Skip to content

Conversation

@andrejcermak
Copy link
Contributor

Hi, I added the application credential support that was missing in this library.

@andrejcermak
Copy link
Contributor Author

@geemus any chance of getting this merged?

class Real
def create_application_credentials(credential = {})
user_id = credential.delete('user_id') || credential.delete(:user_id)
puts Fog::JSON.encode(:application_credential => credential)
Copy link
Member

Choose a reason for hiding this comment

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

I suspect this was unintentionally left behind from testing/debugging.

Suggested change
puts Fog::JSON.encode(:application_credential => credential)

end
end

class Mock
Copy link
Member

Choose a reason for hiding this comment

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

For consistency with other parts of fog, could you add a method to each of the mock versions that has the same signature, and whose body is:

raise Fog::Errors::MockNotImplemented

That way it helps ensure that the behavior is obvious/consistent, as opposed to potentially NoMethod errors or even silently failing if the method is defined without a body as below.

class V3
class Real
def get_application_credentials(id, user_id)
puts "get app creds id: #{id}, from user #{user_id}"
Copy link
Member

Choose a reason for hiding this comment

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

Looks like another leftover.

Suggested change
puts "get app creds id: #{id}, from user #{user_id}"

Copy link
Member

@geemus geemus left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the additions and apologies for my delay in reviewing.

Could you please remove the puts statements and refine the unimplemented mock stuff? I think it should be good to merge once those are adjusted.

Thanks!

@andrejcermak andrejcermak requested a review from geemus March 18, 2025 14:12
Copy link
Member

@geemus geemus left a comment

Choose a reason for hiding this comment

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

It would also be good to get some tests for this too, now that I think about it. I'll bring this in for now, but we should probably follow up with tests soon if possible to help keep it working. It's just a bit hard to have good tests without mocks, and that's a whole other chunk of work.

@geemus
Copy link
Member

geemus commented Mar 18, 2025

Plus the main test suite has been failing for some time now, so also not ideal.

@geemus geemus merged commit bbc2d80 into fog:master Mar 18, 2025
0 of 4 checks passed
@geemus
Copy link
Member

geemus commented Mar 18, 2025

@andrejcermak did you need a release with this?

@andrejcermak
Copy link
Contributor Author

Yes, I intend to use this in other project. I think I can have a look at the tests too.

@geemus
Copy link
Member

geemus commented Mar 18, 2025

@andrejcermak released in v1.1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants