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

update ruby with nokogiri #3009

Merged
merged 7 commits into from
Feb 10, 2023
Merged

Conversation

dheerajd-msys
Copy link
Contributor

@dheerajd-msys dheerajd-msys commented Jan 30, 2023

Description

-- Resolved brakeman failure
-- Update nokogiri as required dependency
-- Update regex to match mimetype for ubuntu 22 to match the any json file to resolve spec in ubuntu 22

ON UBUNTU 22.04
3.0.3 :004 > file_path = '/tmp/metadata.json' => "/tmp/metadata.json" 3.0.3 :005 > IO.popen(["file", "--mime-type", "--brief", file_path]) { |io| io.read.chomp } => "application/json" 3.0.3 :006 >
ON UBUNTU 20.04
3.0.3 :004 > file_path = '/tmp/metadata.json' => "/tmp/metadata.json" 3.0.3 :005 > IO.popen(["file", "--mime-type", "--brief", file_path]) { |io| io.read.chomp } => "text/plain" 3.0.3 :006 >

Issues Resolved

[List any existing issues this PR resolves, or any Discourse or
StackOverflow discussions that are relevant]

Check List

dependabot bot and others added 2 commits January 30, 2023 12:42
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.8 to 1.14.0.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](sparklemotion/nokogiri@v1.13.8...v1.14.0)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Dheeraj Singh Dubey <dhsingh@progress.com>
@dheerajd-msys dheerajd-msys requested review from a team as code owners January 30, 2023 07:23
@netlify
Copy link

netlify bot commented Jan 30, 2023

👷 Deploy Preview for chef-supermarket processing.

Name Link
🔨 Latest commit 54dabee
🔍 Latest deploy log https://app.netlify.com/sites/chef-supermarket/deploys/63e4da85fe6f8f0009d4027e

Signed-off-by: Dheeraj Singh Dubey <dhsingh@progress.com>
@dheerajd-msys dheerajd-msys force-pushed the dheeraj/update-ruby-with-nokogiri branch from 6dc0fcf to e21c5e2 Compare January 30, 2023 07:50
dependabot bot and others added 2 commits January 30, 2023 13:32
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.8 to 1.13.10.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.10/CHANGELOG.md)
- [Commits](sparklemotion/nokogiri@v1.13.8...v1.13.10)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Dheeraj Singh Dubey <dhsingh@progress.com>
@dheerajd-msys
Copy link
Contributor Author

@dheerajd-msys dheerajd-msys force-pushed the dheeraj/update-ruby-with-nokogiri branch 3 times, most recently from 669d5f3 to 973ee4d Compare February 8, 2023 09:50
Signed-off-by: Dheeraj Singh Dubey <dhsingh@progress.com>
@dheerajd-msys dheerajd-msys force-pushed the dheeraj/update-ruby-with-nokogiri branch from 973ee4d to 7e7012b Compare February 9, 2023 04:17
Signed-off-by: Dheeraj Singh Dubey <dhsingh@progress.com>
@sonarcloud
Copy link

sonarcloud bot commented Feb 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -107,7 +107,8 @@ def binary?(filepath)
# need to check for application/xml explicitly because only versions of
# libmagic < 5.26 are available on Ubuntu 14.04 and 16.04 which are our
# CI (Travis and Automate) node platforms
Utils::FileFormat.get_mime_type(file_path: filepath) !~ %r{^(text\/|inode\/x-empty|application\/xml)}
# For ubuntu 22.04 we need to include 'application\/json' to match the json file
Utils::FileFormat.get_mime_type(file_path: filepath) !~ %r{^(text\/|inode\/x-empty|application\/xml|application\/json)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Ubuntu 22.04 MIME TYPE of any json file is being picked up perfectly (as application/json) but not in Ubuntu 20.04 (as text/plain) so we need to include application\/json here in order to decide whether the file passed in this method is binary or not.

@saghoshprogress saghoshprogress merged commit 8a7e787 into main Feb 10, 2023
@saghoshprogress saghoshprogress deleted the dheeraj/update-ruby-with-nokogiri branch February 10, 2023 12:34
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