Skip to content

Lg 7688 dont use Proofing::Base#7349

Merged
gsa-manish merged 3 commits intomainfrom
LG-7688-dont-use-proofing-base
Nov 22, 2022
Merged

Lg 7688 dont use Proofing::Base#7349
gsa-manish merged 3 commits intomainfrom
LG-7688-dont-use-proofing-base

Conversation

@gsa-manish
Copy link
Contributor

@gsa-manish gsa-manish commented Nov 16, 2022

🎫 Ticket

Link to the relevant ticket.

🛠 Summary of changes

Refactored removing Proofing:::Base

@gsa-manish gsa-manish force-pushed the LG-7688-dont-use-proofing-base branch from 0714fd2 to 775b781 Compare November 16, 2022 14:30
@gsa-manish gsa-manish changed the title WIP: Lg 7688 dont use proofing base Lg 7688 dont use proofing base Nov 16, 2022
@gsa-manish gsa-manish changed the title Lg 7688 dont use proofing base Lg 7688 dont use Proofing::Base/Proofing::Result Nov 16, 2022
Copy link
Contributor

@kbighorse kbighorse left a comment

Choose a reason for hiding this comment

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

So great to get rid of that base class, well-done!
[issue] Can we revert uses of Proofing::LexisNexis::Ddp::Result and Proofing::LexisNexis::Ddp::Proofer::Config unless in the DDP context?

Copy link
Contributor

Choose a reason for hiding this comment

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

Wasn't this better before?

Copy link
Contributor

Choose a reason for hiding this comment

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

I second this question. What was wrong with the ddp-mock-transaction-id-123 value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the refactoring it returns 1234 instead of Proofing::Mock::DdpMockClient::TRANSACTION_ID. Do we know if it should return Proofing::Mock::DdpMockClient::TRANSACTION_ID or some internal request ID that gets created?

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like ideally we would change the source of this data instead of changing this test to match. (I don't think it is worth holding up the PR however.)

Copy link
Contributor

Choose a reason for hiding this comment

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

[suggestion] Can we DRY up these stub_request calls?

Copy link
Contributor

Choose a reason for hiding this comment

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

[issue] Can we restore Proofing::ResultSpec?

Copy link
Contributor

Choose a reason for hiding this comment

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

[suggestion] you might consider the more readable %i notation to generate an array of symbols here

Copy link
Contributor

Choose a reason for hiding this comment

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

[suggestion] consider %i

Copy link
Contributor

Choose a reason for hiding this comment

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

[suggestion] add an empty line before a return value

Copy link
Contributor

Choose a reason for hiding this comment

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

[praise] so great these didn't need any more modification!

@kbighorse
Copy link
Contributor

kbighorse commented Nov 16, 2022

[issue] I'm noticing that lexisnexis_ddp_proofer is used (4x) in ResolutionProofingJobSpec but never defined 🤔. Should it be ddp_proofer instead?

@kbighorse
Copy link
Contributor

Approved to unblock merging

@gsa-manish gsa-manish force-pushed the LG-7688-dont-use-proofing-base branch 2 times, most recently from 209a25c to 36d2dbc Compare November 21, 2022 17:45
changelog: Improvements, Refactoring, Remove proofing::base, Proofing::Result
@gsa-manish gsa-manish force-pushed the LG-7688-dont-use-proofing-base branch from 36d2dbc to cf5b4f2 Compare November 21, 2022 18:19
@gsa-manish gsa-manish changed the title Lg 7688 dont use Proofing::Base/Proofing::Result Lg 7688 dont use Proofing::Base Nov 21, 2022
Copy link
Contributor

@jskinne3 jskinne3 left a comment

Choose a reason for hiding this comment

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

I'm so glad to see app/services/proofing/base.rb removed!

class DdpMockClient < Proofing::Base
vendor_name 'DdpMock'
class DdpMockClient
class << self
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did vendor_name, required_attributes, optional_attributes, and stage become class methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since other places rely on DdpMockClient and they currently require them to be class methods, I did not want to mess up the way it accesses them as it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

After looking over the old Proofing::Base I mostly understand this now. 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I second this question. What was wrong with the ddp-mock-transaction-id-123 value?

Comment on lines +68 to +69
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

this indentation seems wrong. I think it was correct before

Suggested change
end
end
end
end

Comment on lines +508 to +514
headers: {
'Accept' => '*/*',
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'Authorization' => 'Basic Og==',
'Content-Type' => 'application/json',
'User-Agent' => 'Faraday v2.6.0',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can do a hash_including here too, user-agent and accept-encoding change often so I'd remove them

Suggested change
headers: {
'Accept' => '*/*',
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'Authorization' => 'Basic Og==',
'Content-Type' => 'application/json',
'User-Agent' => 'Faraday v2.6.0',
},
headers: hash_including(
'Authorization' => 'Basic Og==',
'Content-Type' => 'application/json',
),

@jskinne3 jskinne3 self-requested a review November 21, 2022 22:33
Copy link
Contributor

@jskinne3 jskinne3 left a comment

Choose a reason for hiding this comment

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

Approving because none of my questions are worth holding up this badly-needed PR

@gsa-manish gsa-manish merged commit c0dc267 into main Nov 22, 2022
@gsa-manish gsa-manish deleted the LG-7688-dont-use-proofing-base branch November 22, 2022 15:40
@mdiarra3 mdiarra3 mentioned this pull request Nov 23, 2022
mdiarra3 added a commit that referenced this pull request Nov 23, 2022
This was referenced Nov 29, 2022
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.

4 participants