Skip to content

Commit

Permalink
[NO-TICKET] Fix gem permissions in gitlab build-gem step
Browse files Browse the repository at this point in the history
**What does this PR do?**

This PR is a follow-up to
#3531: In that PR we added
validation for the permissions of the files in the packaged gem.

After merging that PR, @AlexJF noticed that the GitLab CI `build-gem`
job [was failing with](https://gitlab.ddbuild.io/DataDog/apm-reliability/dd-trace-rb/-/jobs/463401683):

```
Unexpected permissions for CHANGELOG.md inside pkg/ddtrace-1.21.0.dev.bfc613b.glci463401683.g20ea0f3a.gem (got 666, expected 644)
```

These permissions are indeed incorrect and don't match the ones we
expect on actual gem releases.

Thus, I've sprinkled a `chmod` call to fix the permissions before
packaging the gem in gitlab.

You can see in
https://gitlab.ddbuild.io/DataDog/apm-reliability/dd-trace-rb/-/jobs/463581213
that it now works fine:

```
gem release process (after packaging)
  sets the right permissions on the gem files
Finished in 0.07305 seconds (files took 1.2 seconds to load)
```

**Motivation:**

Fix GitLab CI pipeline.

**Additional Notes:**

I guess this check is already flagging permission issues!
Great success :)

**How to test the change?**

See above -- I manually triggered the CI pipeline with this change
and confirmed it passes.
  • Loading branch information
ivoanjo committed Mar 20, 2024
1 parent 9d19758 commit d3a2bd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ build-gem:
.gitlab/patch_gem_version.sh glci $CI_JOB_ID $CI_COMMIT_REF_NAME $CI_COMMIT_SHA
fi
- bundle install && bundle exec rake build
- bundle install && chmod go-w -R . && bundle exec rake build
- mkdir -p tmp && ruby -Ilib -rddtrace/version -e 'puts Gem::Version.new(DDTrace::VERSION::STRING).to_s' >> tmp/version.txt
artifacts:
paths:
Expand Down

0 comments on commit d3a2bd2

Please sign in to comment.